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.
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”
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.
One setting to change is to ensure that request will be automatically tracked. Switch to the option tab, as ensure “Inspect Session” is checked.
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.
Be the first to rate this post
- Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5