Saturday, July 30, 2016

Javascript:Create HTTP Request Breakpoint Using Fiddler

Step by step on how to create HTTP request breakpoint in Fiddler.
Fiddler is the tool to record your incoming/outgoing request of your computer. It can do request filtering, HTTPS logging, proxy server simulator, etc. The one of top features is HTTP request breakpoint, which I will show how to use here in this page.

The benefit of creating HTTP request breakpoint is that whenever you computer sent the request, this program will break that request and let you modify the response to be anything you want. This is very useful because it make debugging web application much easier and reduce your work to setting up testing server a lot.

Here is how to create the HTTP request breakpoint in fiddler.

1In filters tab, tick check box 'Use Filters' and set breakpoint condition as you want

2When computer try to request that match the condition, Fiddler will break the request and display icon like this

3Click the request and go to inspectors tab, you can choose any response you want here

4You can review your response and can edit anything as you want. For example, adding CORS header, etc.

Note: you can set response header at the beginning of the file as shown in image below. Fiddler can detect it automatically.

5Click green button 'Run to completion' to send the response to the target client.


Tip: If you use breakpoint frequently, consider using 'AutoResponser' tab. It can response the request automatically.



Happy Coding!

No comments:

Post a Comment