Using IE 9 and F12 to Debug your Web API Service
Sun, Sep 23 2012 17:39
Internet Explorer 9 allows you to see the HTTP request and response information using the F12 developer tools. This can be useful when debugging or testing your ASP.NET Web API service.
[See this prior post for an introduction to building an ASP.NET Web API service. The service created in that post is the example service used here.]
Start your Web API Service in Visual Studio, viewing it in Internet Explorer 9.
I always forget which key to press for the F12 developer tools, but if I recall correctly, it is F12. :-)
The tool window appears as shown below:
Select the Network tab and click the Start Capturing button to start capturing the HTTP request and response information. Then select the browser window and add "api/customer" (or "api/customerVB" for the VB service) to the address bar. Cancel the request to open or save the result.
Returning to the F12 window, you will see the HTTP request:
Select the api/Customer entry and click the Go to detailed view button. From there, you can view the Request header to see more details on the request. Click the Response body to see the response:
Right-click on the body and select Word Wrap from the context menu to view the JSON in a nicer layout:
Use the F12 tool whenever you need to debug or test your Web API service or any client calling your Web API service.