The following requests for HTTP protocol
Many netizens are still confused how to write JMeter script
Beginners like to use badboy this grab bag tool, it is convenient, can automatically pull the packet request, into the JMX script
However, including other auto-grab tools have drawbacks,
Is that there are too many requests to be caught, and it is not accurate to know that those requests are useful and need one to try,
What's more, the operation is cumbersome, either setting up the agent or running it in its proxy browser ...
Here I introduce to you, several hand-grasping tool, do performance test engineer, need to understand the real request package
An HTTP request, we focus on a few points
1. Path: Remove the domain name and port suffix section, the first page is usually/, other pages/page1/...
2. Type of request: generally get,post
3. Request header (HTTP header): This is more important, where content-type is commonly used by developers, such as Json,xml format data, will have the corresponding content-type type, must be set, Otherwise, the server does not recognize
1, the service side need to return a piece of ordinary text to the client, content-type= "Text/plain"
2, the server needs to return a piece of HTML code to the client, content-type= "text/html"
3, the server needs to return a piece of XML code to the client, content-type= "Text/xml"
4, the server needs to return a piece of JavaScript code to the client,content-type= "text/javascript"
5, the server needs to return a JSON string to the client,content-type= "application/json"
The above type is the general wording, but according to the actual capture package format, the general situation in the first 2 does not need to add Content-type, the following 3 need to add, otherwise the default is normal text, the server will be thrown wrong, can not be processed.
4. Request parameters, very simple is the request parameters, it is easy to identify
The above four kinds of data is necessary to know, in the actual application, the developer may also use other header information, this can only be added according to the actual situation, do not need to pick up all the header information to add
It's enough to return the response correctly.
Chrome developer Tools Grab, for example, other tools like
(Windows system click F12 to bring up the developer tools, select Network, and then start the request, will automatically grab the package)
Grab Bag:
1. PC-side Web mode
2. Mobile-side emulation mode
JMeter script to grab the bag in combat