Debugging HTTP Requests and HTTP Response
We day by day interact with many websites during web browsing. To get any web resource using web browser we generally fire http request to server.
As we belong to developers, we should know what we are sending to server from our browser using http request and what we are getting from server as http response.
Here I would like to introduce an easy way by which we can see entire details of Http request and http response.
It is general awareness document.
Client – Server Request/Response diagram
Our objective here is to capture following things during Http request and Http response
a) Request Headers
b) Getting Cookie information
c) Request body
d) Response headers
e) Response body
We would like to use IE 9 for this purpose.
1) Open a IE 9 browser
2) Press F12
After pressing f12 you will see the screen below.
3) Click on Network Tab and then click on Start capturing button (from screen at step 2).
4) After clicking start capturing, Type any URL at address bar. Here I have typed http://c-sharpcorner.com
Following screen will appear
5) Deeper look of step 4.
Description of Request (Here from above screen we can see following things).
a) Method type of HTTP request
b) Status column (Result) with status code. Here for first line it is 200 means status is success.
c) Content type of request.
d) Amount of bytes received
e) Time taken for request. And so on.
6) Now double click on first selected row. We will get details of selected row. Following screen will display.
Here we can see following details
a) Request headers
b) Request body
c) Response headers
d) Response body
e) Cookies and so on.
· Screen for response headers
We can see various details of HTTP response from server.
· Screen for response body
Here we can see the html code which has been sent from server.
· Screen for cookies
· Screen for timings
In this screen we can see the timings between request and response from server.
By using IE9 we can debug http request and http response to check the details behind the scene.