当前位置:网站首页>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

边栏推荐
- Recommendation of books related to strong foundation program mathematics
- Interval product of zhinai sauce (prefix product + inverse element)
- Battle drag method 1: moderately optimistic, build self-confidence (1)
- 运维各常用命令总结
- 上周内容回顾
- Test changes in Devops mode -- learning and thinking
- Xai+ network security? Brandon University and others' latest "interpretable artificial intelligence in network security applications" overview, 33 page PDF describes its current situation, challenges,
- LabVIEW training
- leetcode-540. A single element in an ordered array
- Ask and answer: dispel your doubts about the virtual function mechanism
猜你喜欢

一台服务器最大并发 tcp 连接数多少?65535?
![Measurement fitting based on Halcon learning -- Practice [1]](/img/71/9f6c27aa89035b2550bdb0ac902045.jpg)
Measurement fitting based on Halcon learning -- Practice [1]

鹏城杯 WEB_WP

The "boss management manual" that is wildly spread all over the network (turn)

Yyds dry goods inventory TCP & UDP

"Actbert" Baidu & Sydney University of technology proposed actbert to learn the global and local video text representation, which is effective in five video text tasks

2.5 conversion of different data types (2)

Qt6 QML Book/Qt Quick 3D/基础知识

Basic knowledge of dictionaries and collections

LabVIEW training
随机推荐
鹏城杯 WEB_WP
一台服务器最大并发 tcp 连接数多少?65535?
C 10 new feature [caller parameter expression] solves my confusion seven years ago
App compliance
[gd32l233c-start] 5. FLASH read / write - use internal flash to store data
It is discussed that the success of Vit lies not in attention. Shiftvit uses the precision of swing transformer to outperform the speed of RESNET
Basic preprocessing and data enhancement of image data
The global industrial design revenue in 2021 was about $44360 million, and it is expected to reach $62720 million in 2028. From 2022 to 2028, the CAGR was 5.5%
How to modify the network IP addresses of mobile phones and computers?
上周内容回顾
Apprentissage intensif - notes d'apprentissage 1 | concepts de base
Kubernetes abnormal communication network fault solution ideas
Thread, thread stack, method stack, the difference of creating thread
2.5 conversion of different data types (2)
SQL injection - Fundamentals of SQL database operation
Print linked list from end to end
(5) Web security | penetration testing | network security operating system database third-party security, with basic use of nmap and masscan
Use of CMD command
Fingerprint password lock based on Hal Library
Measurement fitting based on Halcon learning -- Practice [1]