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