How to modify a request in Fiddler?
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
- On the right hand side, click on the filters tab
- Check 'Use Filters'
- On Hosts, use 'Show only the following Hosts'
- In the text box below that, put the host you are testing for. In our case for the test environment, put the following: testing.internalsite.com;
- In the section called 'Breakpoints', check 'Break request on POST'
-
Intercept the request
- In your browser, navigate to the page which you are testing. In our case, it is the welcome page where we will be doing our testing of the server-side validation: https://testing.internalsite.com/yourapp/welcome.do
- Clear all the existing logged requests by hitting the 'X' in the tool ribbon and choosing 'Remove all'.
- In your browser, put the data into the form you are interested in testing and hit submit. This is valid data (passes client side validation) which you will be changing with fiddler.
- In Fiddler, you will see the request with the red icon. Click on the request to load the details on the right side.
- On the Inspectors tab, followed by the WebForms tab, you can modify the parameters of the form which was submitted. Change the data as appropriate for the test.
- Hit the 'Run to completion' button
-
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.