jmeter how to set headers

Headers common fields: User-Agent, Accept, Content
User-Agent -Type browser type, operating system and version, browser rendering identification information of the engine, browser language, the server depending on the user to use the browser to display a different layout so to provide users with a better experience (ie, browser compatibility).

Belongs Accept request header, Content-Type header entity belongs.
AcceptOn behalf of the sender (client) you want the data type to accept. 
For example: Accept: text / xml; 
data representative of the type of the client is willing to accept the type of xml

Content-TypeData types entity data transmission | (Server Client) on behalf of the sender. 
For example: Content-Type: text / html  ;
data format representative of the sender sends the html.

Common content-type

(1) application / x-www -form-urlencoded
most common POST submission of the data, if you do not set the Headers content-type, basic data will be submitted to the default application / x-www-form- urlencoded manner.
(2) application / json
now more and more people use it as a request header, the message body is used to tell the server JSON string is serialized. This embodiment may be conveniently submitted to complex data structures, especially for RESTful interface. Major capture tool comes as Chrome Developer Tools, Firebug, Fiddler, will demonstrate JSON data in a tree structure, very friendly and intuitive.
(3) multipart / form-data
. This mode is used to upload files.
(4) text / xml
XML as the encoding of the remote calling convention, usually with less.

 

example:

 

Guess you like

Origin www.cnblogs.com/lhm-test/p/11099255.html