I'm looking for a simple way to intercept a web request and modify the contents of the request (mainly POSTs) using Fiddler.
This is to test server-side validation.
I have to use Fiddler, however I haven't found a good simple way to do so.
There have been several documented ways to write scripts to intercept traffic and change headers, but I would like to do it without writing a script - this tool needs to be used by the testers and writing/modifying scripts all the time by different testers may be annoying.
Example:
Simple POST with 2 parameters:
field1=foo, field2=bar
I would like to intercept the request, modify the value of field2 to be something like bañ (note the ñ, in my case is invalid and that is what I want to test).
Right next to the green Run to Completion button (which you click to send the response) there's a dropdown that lets you choose some default response types. Or, on the Headers inspector, change the response code & message in the textbox at the top.
Fiddler's default rules are stored in \Program Files\Fiddler2\Scripts\SampleRules. js. You can change the JScript editor launched from the Rules menu. Click Tools | Fiddler Options and edit the Editor string.
Capture a request using Fiddler. Select the request, right-click, and click Replay > Reissue Requests (Or just click and type R). Select multiple requests and do the same steps. The same request can be run many times using this method.
Ok, posting the answer that I put together from piecing it together from the following youtube video:
Tampering Client Requests and Server Responses with Fiddler
Start fiddler (I'm using Fiddler 4)
You will notice that it intercepts all traffic through all browsers and other applications
Set a filter - this will enable you to view only the data you are interested in
Intercept the request
Validate that your response is correct - usually some sort of error message if you are testing the server-side validations
I use fiddler 4.6.3. You can try this if you are submitting a web form.
Note the post request when you submit a form. Let that request remain in fiddler. Lets modify the request in Fiddler.
1 - Right click request > check "unlock for editing".
2 - Inspector tab > Modify form fields such as username, password etc. in Body section.
3 - Right click request > Replay > Reissue request.
Done ! The only problem with this approach is that you modify the old request. In Charles proxy, this is done in 2-3 clicks vs the many clicks in Fiddler. Plus, you don't have to mess the old request.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With