Use fiddler to simulate http requests and fiddler to simulate requests
Source: http://zhuqil.cnblogs.com
Overview
Compared with httpwath, fiddler is able to simulate http requests, breakpoint debugging, and http analysis statistics. After using it, I feel that this tool is very good. This article only introduces how fiddler works, it briefly introduces its important functions and how to use fiddler to simulate http requests to meet the debugging requirements of mobile server developers. You can study other functions by yourself.
How fiddler works:
When you start Fiddler, the program will act as a system proxy for Microsoft Internet services. As a system proxy, all http requests from Microsoft Internet Service (WinInet) will go through Fiddle before they reach the target Web server. Similarly, all Http responses will flow through Fiddler before returning to the client. For example:
Important fiddler functions:
1. HTTP statistics view: used to analyze http requests, for example, 83 http requests:
2. debug with Fiddler: When you choose beforerequest in the rules-automatic breakpoints option of the software menu, or when these request or response attributes can match the target criteria, fiddler can pause Http Communication and allow modification of requests and responses. This vs breakpoint debugging is quite practical.
For example, I request login. Before submitting the request to the server, you can pause the request and forcibly modify httphead, for example:
Then, click "run to finish:
3. Fiddler Extension: fiddler is developed using. net and can be expanded using scripts and. net.
Use Request Builder to simulate http requests
For mobile server developers, It is very convenient to use this tool to simulate mobile client requests.
Get request:
Select GET in the drop-down box, enter the Request address, and enter Request Headers. Request Headers are key-value pairs separated. Click execute.
You can see the corresponding results in:
Post request: FOR post requests, enter the Reuqest Body. The Request Body is hidden by default. Follow these steps to display the Reuqest Body.
1. Click Options.
2. Click Tear off, as shown in.
Click execute to simulate the post request.
Summary:This article briefly introduces the principles and important functions of fiddler, as well as how mobile server developers simulate http requests to facilitate code debugging.