[JMeter]: HTTP sampler Parameters, Body data usage differences

Source: Internet
Author: User

First, the use of JMeter interface testing, headers and request parameters parameters, Body Data Contact

1, when using parameters, Content-type does not pass the default value is: application/x-www-from-urlencoded, or direct transmission application/x-www-from-urlencoded, If the transmission Application/json error.

2, when using the body data, Content-type can be transmitted application/x-www-from-urlencoded or Application/json, the difference between the data format is different.

Second, headers characters commonly used section

User-agent, Accept, Content-type

Browser information, the type of data the sender wants to receive, the type of data sent by the sending side

Third, Content-type

(1) application/x-www-form-urlencoded

Post request mode, if you do not set headers Content-type, the basic default is to submit data application/x-www-form-urlencoded.

(2) Application/json

More and more people now use it as a request header to tell the server that the message body is a serialized JSON string. This scheme allows for easy submission of complex structured data, especially for RESTful interfaces. The big grab kits, such as Chrome's own developer tools, Firebug, and Fiddler, will display JSON data in a tree-like structure, very friendly and intuitive.
(3) Multipart/form-data
This method is commonly used to upload files.
(4) Text/xml
XML is generally not used as a remote invocation specification for encoding.

Four, JMeter interface application

(1) content-type=application/x-www-form-urlencoded + Parameters

(2) content-type=application/x-www-form-urlencoded + Body Data

(2) Content-type=application/json + Body Data

Add the HTTP header manager, specifying the Content-type value, because the value defaults to application/x-www-form-urlencoded

JSON Format data

(4) Directly behind the URL stitching parameters, get request method commonly used, Post request method is not recommended.

[JMeter]: HTTP sampler Parameters, Body data usage differences

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.