Saturday, March 2, 2013

Inspecting Browser Requests and Server Responses with Fiddler

With Fiddler, not only can you inspect the browser requests, and the server responses, but you can alter them.

Note: To filter the traffic to only localhost, so Fiddler ignores other requests, do this (you need to click in the window on the left to get this to save):



In order to intercept a browser request to the server, turn on automatic breakpoints in Fiddler:


Note: You may not want to set automatic breakpoints until just before the actual request is sent. Otherwise, Fiddler will start breaking on all requests.

Make sure Fiddler is set to capture traffic:


Initiate a request. In this scenario, I'm running an app from Visual Studio and eventually hitting a save button, on a web page, to submit a request to the server. When I click the save button, Fiddler will break on the request. You can click on the request to view the data being sent.



This is what you'll see in the right pane of Fiddler:


In the above image, the top pane is the request details, and the bottom pane is the response details.