Seeing the HTTP Request and Response of the Web API Application

Introduction

This article describes how to see the HTTP Requests and Responses of a Web API Application. For displaying the HTTP Request and Response we use the F12 key tools on Internet Explorer 9.

Step 1

First you need to create a Web API Application. You can see how to create a Web API application in the following article:
Calling ASP. NET Web API With JQuery and JavaScript.

Step 2

Now debug the ExampleAPI Application with Internet Explore 9.

Step 3

Now for seeing the HTTP Request and Request messages press the F12 key of the Keyboard.

It looks like this:

s1.jpg

Step 4

From the IE window:

  • Click on Network
  • Press the Start Capturing tab
  • Back to the Web Page of the ExampleAPI Application and press the F5 for reloading the Web page.
  • Now see the Internet Explorer that captures the HTTP traffic of the browser and the web server.
  • And the Internet Explorer look like this:
s2.jpg

Step 5

For locating the relative URI "api/items", select this entry and click on the Go to detail the view tab. In this detail view you will see the request headers, Request body, Response header and Response body. If you click on the Request headers tab then you can see the client request.

s3.jpg

Step 6

If you want to see how the List of items are serialized to the JSON then click on the Response body. It looks like this:

 s5.jpg


Similar Articles