Go from: impersonate a client HTTP response using fiddler
In client development, it is often necessary to deal with some special cases, such as 404, 503, and so on, such as service return error data. Testing these situations can be cumbersome, often looking for developers to work with the code to modify, so the efficiency is not high.
After touching the Fiddler, this is not the case, we can easily simulate the HTTP response via the Fiddler's own Autoresponder tool. Fiddler's Autoresponder Tab allows you to return files locally without sending an HTTP request to the server.
Here's the tutorial:
1. First crawl the HTTP request of the client (refer to another article Android/ios phone using fiddler grab bag)
2. Open Fiddler to find Autoresponder
3. Select Enable automatic reaponses and unmatched requests passthrough
4. Select the HTTP request that you snapped to the left and click Add Rule
5. In the following rule Editor drop-down Select the response type to simulate, 200, 404, 502, etc. (you can also create Response yourself, check the Create New Response ..., if you want to replace some paging file, select Find a file). Finally click Save.
6. After the rule is established, the request to the original URL becomes the response you specified, and then the original URL can be requested to see the effect.
A regular expression is used at the link :
The prefix "Exact:" indicates an exact match (case sensitive)
No prefix indicates a basic search, which means that the search string matches
The prefix is "REGEX:" to indicate the use of regular expression matching
The prefix is "REGEX: (? insx)" to indicate the matching method where:
I means case insensitive;
n indicates that the only valid capture specified is the form of an explicit name or number;
s denotes single-line mode;
x denotes a space description;
OK, no longer need to find developers to modify the code!
Using Fiddler to impersonate a client HTTP response "Go"