2021-01-05JMeter basics: the difference between request parameters Parameters and Body Data

tags: jmeter

reference:JMeter basics: the difference between request parameters and body data
JMeter basics: the difference between request parameters Parameters and Body Data

Jmeter contains two parameterization methods: Parameters and Body Data. What is the difference?

  • When using Parameters, the Content-Type is not passed, or application/x-www-form-urlencoded is passed directly, if there is an error in passing application/json.
  • When using Body Data, Content-Type can be passed application/x-www-form-urlencoded or application/json. The difference between the two is the data format.

 

Generally speaking, Parameters are used for Get requests and Body Data is used for Post requests.

The exact statement for Post is:

  • For normal post request and upload interface, select Parameters.
  • json and xml point data format request interface, select Body.

To explain in detail, according to the format of the post request data, there are two cases: map format and json format.

  • Post request data is in map format

When the post request data is in map format, that is, the parameter name and the parameter value are key-value key-value pairs, the requested parameters can be added in the Parameters parameter table

When using jmeter, add the request data in json format to the http request BodyData

In addition, due to the POST request method, if the content-type of Headers is not set, the data will be submitted in application/x-www-form-urlencoded by default. In order to ensure that the Post request is in json format, you also need to declare in the request header that the format of the request parameters is json. The specific operations are as follows:

Thread Group right click Add "Config Element" HTTP Header Manager, open the HTTP header manager, Add a Name as Content-Type, Value as application/json
As shown in the figure below, when logging in, the parameter name and parameter value are key-value pairs, and the requested parameters can be added to the Parameters parameter table.

Intelligent Recommendation

Parameters and body data in JMeter

Reprinted https://blog.csdn.net/lluozh2015/article/details/51548243 When doing the concurrent test of the interface, I found that the two parameter formats of Parameters and Body Data in Jmeter are no...

FastApi --- Request Body - Multiple Parameters

content 1, mix using Path, Query and request body parameters 2, multiple request body parameters 3, a single value in the request body 4, multiple request body parameters and query parameters 5, embed...

The difference between params and data when Axios sends a request [request payload and query string parameters]

1, Error example—query string parameters 2. Correct example—request payload Just will 3-1, parse request payload and query string parameters Back-end interface requirements -------- The po...

Additional: [POST request: What is the difference between putting method parameters in the url and putting them in the body]; also includes [@Param, @RequestParam, @RequestBody these three [related to receiving parameters] annotations, summary];

illustrate: (1)Why did you write this blog? :exist【Spring Boot e-commerce project 23: Commodity classification module 2: [Add catalog classification] interface;], I found that some POST request parame...

More Recommendation

Jmeter-Parameters\Body Data\Files Upload parameter type difference

There are three forms of entry and upload of the entry parameter of jmeter's HttpRequest, namely: Parameters\Body Data\Files Upload. Parameters type: Generally in form form, spliced ​​in the form of k...

The difference between post request and get request passing parameters

HTTP requests are divided into url requests and body requests according to the type of data transfer. According to semantics, get requests to obtain resources or queries from the server, and post requ...

2021-08-22 Java basic data type and reference data type as the difference between method parameters

Java basic data type and reference data type as the difference between method parameters Value transfer and method parameters Basic data type as method parameters Reference data type as method paramet...

ElateSearch (6) ---- Request parameters with request body

I. Grammar format Get index / _search { “command”:{ “parameter_name” : “parameter_value”} } 1. Query all data 2. Conditional Search (Spreading the conditions) 3. Ph...

The difference between Request Payload, Query String Parameters, and Form Data for HTTP requests

When transferring data with the server, the GET and POST methods are usually used for parameter submission, and the method of parameter submission usually depends on the way the server receives the da...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top