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

边栏推荐
- Discussion Net legacy application transformation
- Qtablewidget control of QT
- TLS environment construction and plaintext analysis
- 11-grom-v2-05-initialization
- Wargames study notes -- Leviathan
- Task of gradle learning
- Sort out several network request methods of JS -- get rid of callback hell
- Example of peanut shell inner net penetration
- Machine learning support vector machine SVM
- Print linked list from end to end
猜你喜欢
AI enhanced safety monitoring project [with detailed code]
Q&A:Transformer, Bert, ELMO, GPT, VIT
2022 melting welding and thermal cutting examination materials and free melting welding and thermal cutting examination questions
不同业务场景该如何选择缓存的读写策略?
How can the outside world get values when using nodejs to link MySQL
"Designer universe" argument: Data Optimization in the design field ultimately falls on cost, safety and health | chinabrand.com org
[gd32l233c-start] 5. FLASH read / write - use internal flash to store data
Qt6 QML Book/Qt Quick 3D/基础知识
Camera calibration (I): robot hand eye calibration
Hcie security Day10: six experiments to understand VRRP and reliability
随机推荐
Q&A:Transformer, Bert, ELMO, GPT, VIT
Camera calibration (I): robot hand eye calibration
Nmap and masscan have their own advantages and disadvantages. The basic commands are often mixed to increase output
Viewing Chinese science and technology from the Winter Olympics (II): when snowmaking breakthrough is in progress
Apprentissage intensif - notes d'apprentissage 1 | concepts de base
2022 melting welding and thermal cutting examination materials and free melting welding and thermal cutting examination questions
"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
Redis data migration (II)
The 29th day of force deduction (DP topic)
Based on laravel 5.5\5.6\5 X solution to the failure of installing laravel ide helper
Rhcsa third day notes
[gd32l233c-start] 5. FLASH read / write - use internal flash to store data
Task of gradle learning
Plan for the first half of 2022 -- pass the PMP Exam
University of Electronic Science and technology | playback of clustering experience effectively used in reinforcement learning
Summary of common operation and maintenance commands
How to modify the network IP addresses of mobile phones and computers?
Get log4net log file in C - get log4net log file in C
MySQL learning notes - single table query
jvm jni 及 pvm pybind11 大批量数据传输及优化