当前位置:网站首页>Software testing skills, JMeter stress testing tutorial, obtaining post request data in x-www-form-urlencoded format (24)
Software testing skills, JMeter stress testing tutorial, obtaining post request data in x-www-form-urlencoded format (24)
2022-07-03 20:56:00 【Test pursuit】
Catalog : Reading guide
One 、 Preface
post Some of the requested parameters are json Format , There are also some x-www-form-urlencoded Format , When we talked about signature, we got post The request is json Format
This article continues x-www-form-urlencoded Format request body How to get
Two 、x-www-form-urlencoded
Add... To the request header Content-Type The type is x-www-form-urlencoded
Define user variables , Account and password 
post Request parameter to fill in key value pair 
3、 ... and 、BeanShell Preprocessor
add to - Preprocessor -BeanShell Preprocessor 
Use getArgumentsAsMap() Method to get a request for a key value pair body
import org.apache.jmeter.config.Arguments;
import org.apache.jmeter.config.Argument;
import org.json.JSONObject;
import org.json.JSONArray;
import org.apache.commons.codec.digest.DigestUtils; // Import md5 Encrypted package
Arguments arguments = sampler.getArguments();
Map reqMap = arguments.getArgumentsAsMap();
log.info("------------------------body------------------");
for (String key : reqMap.keySet()) {
log.info("key: " + key + ",value: " + reqMap.get(key));
}
log.info(reqMap.get("username"))

Four 、 View the run results
The number of results can be viewed from the request header parameter type 
request body data :username=test&password=123456

边栏推荐
- First knowledge of database
- Etcd raft Based Consistency assurance
- Node MySQL serialize cannot rollback transactions
- Deep search DFS + wide search BFS + traversal of trees and graphs + topological sequence (template article acwing)
- MDM mass data synchronization test verification
- Golang type assertion and conversion (and strconv package)
- [Tang Laoshi] C -- encapsulation: member variables and access modifiers
- Phpexcel import export
- Battle drag method 1: moderately optimistic, build self-confidence (1)
- 设计电商秒杀系统
猜你喜欢
![C 10 new feature [caller parameter expression] solves my confusion seven years ago](/img/32/2d81237d4f1165f710a27a7c4eb1e1.jpg)
C 10 new feature [caller parameter expression] solves my confusion seven years ago
![[Yugong series] go teaching course 002 go language environment installation in July 2022](/img/47/35b4fb0354122e233977b261ef405b.png)
[Yugong series] go teaching course 002 go language environment installation in July 2022

Such as the visual appeal of the live broadcast of NBA Finals, can you still see it like this?

Discussion Net legacy application transformation

Redis data migration (II)

Basic knowledge of dictionaries and collections

Gee calculated area

Shortest path problem of graph theory (acwing template)

Interval product of zhinai sauce (prefix product + inverse element)

浅议.NET遗留应用改造
随机推荐
Phpexcel import export
jvm jni 及 pvm pybind11 大批量数据传输及优化
Brief analysis of ref nerf
Read the root directory of the folder, write txt and generate random samples
运维各常用命令总结
Basic preprocessing and data enhancement of image data
设计电商秒杀系统
Discussion Net legacy application transformation
AI enhanced safety monitoring project [with detailed code]
How to set the system volume programmatically- How to programmatically set the system volume?
jvm jni 及 pvm pybind11 大批量数据传输及优化
淺析 Ref-NeRF
6006. Take out the minimum number of magic beans
University of Electronic Science and technology | playback of clustering experience effectively used in reinforcement learning
Set, weakset, map, weakmap in ES6
强化学习-学习笔记1 | 基础概念
Kubernetes 通信异常网络故障 解决思路
【leetcode】1027. Longest arithmetic sequence (dynamic programming)
Refer to some books for the distinction between blocking, non blocking and synchronous asynchronous
MySQL master-slave synchronization principle