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 not simple. One is xx=xx, and the other is a parameter in json format.

First look at an interface

[post] /api/xx/xxxx/xxxx notify the server that the file upload is complete
  • 1

Input parameters:

http content type: application/json

 Name | Type | Required | Parameter Limit | Description
--------- | ----------- | -------- | ---------- | ----------
cid | string  | Yes | cid.length==36 | id
version  | int | yes | no | version

At the beginning the request in Jmeter was

The result returned by the request is

{"msg":"{\"message\":\"error\",\"error_code\":4000}","ret":"error"}
  • 1

After searching, it is found that it is the use of Parameters and Body Data, and the requested parameters are misunderstood.

Take a closer look at the two "parameters" in the packet capture

xx=xx&xxx=xx format

json format

Parameters

The parameter in the format of xx=xx&xxx=xx is the value of the parameter in the url in the GET or POST request, such as:

In one such request/api/xx/xxx/xxxx?index=0&pagesize=100&thumb=1
? The number after the number can be written in the url or in the parameters

Body Data

The json format is the parameters in the POST request. When the POST request parameters, look at the format of the request. Do you need to add an HTTP header manager to the request toContent-Type OrUser-Agent Wait for definition

HTTP request format:

HTTP header manager:

Intelligent Recommendation

The body data in jmeter is submitted using the json format of the post request

I previously introduced the default submission form of jmeter post to express submission, Content-type = "application / x-www-form-urlencoded", use the form of directly filling in the parame...

Jmeter gets database table data as parameters

Import mysql driver Import mysql-connector-java-5.1.44.jar into the jmeter/lib path Create and set mysql connection configuration Right-click on the thread group: Add-Configuration Element-JDBC Connec...

JMeter pressure test 36- Request Body Auto Signature Belt Sign Parameters

Foreword The interface request body with the SIGN signature parameter, the SIGN signature is generated after the splicing request parameter is generated after the SIGN itself is removed according to t...

Springmvc / SpringBoot - Get Parameters / Maxets - URLENCODED / FORM-DATA / BODY / Multiple Body

Original website:SpringMVC / Springboot - Get Parameters / Maxets - URLENCODED / FORM-DATA / BODY / Multiple Body_IT Blade Outbound Blog - CSDN Blog Introduction When developing, we will get the param...

More Recommendation

In JMeter Send Post request, about the request body Form-Data, X-WWW-FORM-Urlencoded, JSON data configuration

1.0 Request data is Form-DATA 2.0 Request data is X-WWW-Form-Urlencoded first step: Test Plan -thread group -HTTP request -check the results tree Step 2: Definition directly in the parameter third ste...

JMeter solves the problem of garbled in the body

1. Enter the bin directory under the JMeter directory, open the JMeter.properties file with the text editing tool UE or NOTEPAD ++, etc. Edit: Find line: # SampleResult.default.Encoding = ISO-8859-1 M...

C# method body parameters

What I want to write today is the parameter setting of c#. Generally, our functions or methods can accept parameters. such as: Then there is this, is it very familiar? Here is a function with paramete...

Structural body function parameters

Role: Transferring structs as parameters to functions...

Structural body as function parameters

Structural body as function parameters First, value transmission Second, the reference transmission Third, pointer delivery Take the pointer of the structure as a solid...

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

Top