In performance testing, it is much important to understand about HTTP request and response. In this blog post, we will see about HTTP request and its anatomy.
Each HTTP request consists of following sections: Request Line, Request Headers, An Empty Line, and Request Body which is optional. Request line and headers must all end with <CR><LF> carriage return. Empty line must end with <CR><LF> and no whitespace. In HTTP/1.1 protocol, all headers except Host are optional.
Request line begins with a method token, followed by the request URI (Uniform Resource Identifier) and the protocol version.
Following are the request methods:
Request URI identifies which resource needs to be requested.
After declaring the request method and URI, you need to mention the protocol version. Following is the example of a request line.
GET http://www.mywebsite.com/index.html HTTP/1.1
Request headers will be used to pass additional information to the server. Information such as
Connection: keep-alive Accept-Language: en-US Accept: image/jpeg, image/gif, image/pjpeg, application/x-ms-application, application/xaml+xml, application/x-ms-xbap, */* User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; .NET4.0C; .NET4.0E; InfoPath.3) Accept-Encoding: gzip, deflate Host: www.example.com
During performance testing, you may need to parameterize GET and POST methods. It is not just username, passwords, order numbers etc. you need to correlate the session ids, random numbers etc.
Please Sign up for our free newsletter and support us!