jmeter HTTP request to the content-type

For the first time students contactless interface for himself when sending a http request, there will always encounter various problems, such as will pass parameter does not exist ah

Similar problems arise such problems should be the first rule of the content-type is correct, then what is the content-type it?

In the process of client and server interaction via http request, you gotta tell the server what format you pass the type of data it (easy to parse the data server)

content-type is to tell the client server data is similar to what is, and is the first to pass through the header of the server,

So before a test request, be sure to find out http data format is what type of

 

Type content-type value

1、content-type:application/x-www-form-urlencoded

  By default, if you do not specify the content-type, use this format by default

  It used to transfer data in the form of post

  key1=value1&key2=value2

 

2、content-type:application/json

  json format

  Post transfer using a data format used when:

    {

     "key1":"value1",

     "key2":"value2"

    }

3、content-type:multipart/form-data

  Upload file format

 

In the application of jmeter

In jmeter can use the configuration information element --HTTP head manager to specify the http header request header the content-type value,

Thus all http requests for content-type used in a thread group are defined by values

 

 If the data format is simply json application / x-www-form- urlencoded into application / json to

More testing technology to share please pay attention to micro-channel public number

 

Guess you like

Origin www.cnblogs.com/yaoqingzhuan/p/10949216.html