x

How to Do a Post Using Fiddler

by Gareth Downes-PowellUpdated September 28, 2017

Fiddler is an HTTP debugging tool created by Microsoft developer Eric Lawrence. You can use Fiddler to capture all the HTTP traffic between an application, such as a Web browser, and a server, enabling you to see exactly what is going on in the background. This is invaluable for debugging Web applications and allows you to quickly track down the cause of errors. You can also use Fiddler to generate HTTP POST or GET Web requests to send custom data to your application for testing, and then capture the reply.

Click on the Windows "Start" menu, click on "All Programs" and then click on "Fiddler2" to launch the application. Click "File" and "Capture Traffic" if it is ticked to turn off background HTTP captures.

Click on the "Request Builder" tab, located in the tab bar at the top of the window on the right side of the screen. This has an icon containing a picture of the earth and a hammer. Click on the "Parsed" tab if it is not already active from the tabs at the top of the Request Builder window.

Click "POST" from the drop-down menu to select an HTTP POST request. In the address box next to the drop-down menu, type in the address of the page the POST request is to be sent to, for example "http://www.mysite.com/page.php."

Type the following line in the Request Headers box:

Content-type: application/x-www-form-urlencoded

This lets the receiving page know the type of data that is being sent, in this case standard HTML form data.

Add the variables to be sent in the Request Body box in URL-encoded format to encode any nonstandard characters.

name=example&action=add

This sends two name value pairs to the target page, simulating two form fields named "name" and "action."

Click on the "Options" tab, and ensure Inspect Session is selected. This enables Fiddler to capture and display the response from the target page.

Click on the "Execute" button in the top-right corner of the Request Builder window. This sends the entered data to the target page using an HTTP POST request. The response is then captured, which you can view using the Inspectors tab.

Tips

If you have captured a POST request from an application in Fiddler, you can modify the captured values and resend the request for quick debugging.

Video of the Day

Brought to you by Techwalla
Brought to you by Techwalla

More Articles