Simulating POST with Fiddler

Sometimes its useful to simulate POST action on a WebForm or a Webservice in ASP.NET for debugging.  Fortunately Fiddler allows you to compose (construct) such a request.  First thing to do is fire up Fiddler.  Jump to the “Request Builder” tab.

image

From the drop down, select “POST”.  Put the URL you are testing in the textbox.  The other thing to input is in the “Request Headers” field which is to let the receiving page that form data is being passed.  “Content-type: application/x-www-form-urlencoded”

image

The final piece of data is the key value pairs of the data to be passed.  Make sure these values are URL encoded.  Put this in the “Request Body” field.

image 

One setting to change is to ensure that request will be automatically tracked.  Switch to the option tab, as ensure “Inspect Session” is checked.

image

Click “Execute” to fire off the request.  This can be really useful if you need to debug something.  Make sure your ASP.NET development server is running.  In this case mine is running on localhost, port 8080.  Set your breakpoint in Visual Studio and then fire off the request.  Then the breakpoint will catch and you can step through.  This is a great way to test different variations of data POSTs.

Technorati Tags: ,,,,
6. May 2010 07:40 by Danny Gershman | Comments (3) | Permalink

Comments

Add comment


(Will show your Gravatar icon)  

  Country flag


Enter Numbers In Image Above: biuquote
  • Comment
  • Preview
Loading



About dannyg

dannyg has been writing software for the last 12+ years and worked with various languages and programs.  He specializes business process automation, versatile solutions and R&D.