Detailed explanation of the use of Fiddler packet capture tool - Warm a pot of sake - Blog Park (cnblogs.com) https://www.cnblogs.com/hong-fithing/p/7582947.html Official website download address:Fiddler4 (telerik.com)
1. Introduction to Fiddler
Fiddler is one of the most powerful and easy-to-use web debugging tools, it can record http and https requests of all clients and servers. Allows you to monitor, set breakpoints, and even modify input and output data. Fiddler includes a powerful event-based scripting subsystem and can be extended using the .NET language. In other words, the more you know about the HTTP protocol, the more you can master how to use Fiddler. The more you use Fiddler, the more it will help you understand the HTTP protocol. Fiddler is a very useful tool for developers or testers.
Second, the working principle of Fiddler
Fiddler works as a proxy web server, it uses proxy address: 127.0.0.1, port: 8888. When Fiddler exits, it will automatically log off, so that it will not affect other programs. However, if Fiddler exits abnormally, because Fiddler does not automatically log out at this time, the webpage will be inaccessible. The solution is to restart Fiddler.
Personal understanding: fiddler is a packet capture tool. When the browser accesses the server, a request will be formed. At this time, fiddler is between the requests. When the browser sends a request, it will first pass through fiddler and then go to the server; when the server returns When the data is displayed to the browser, it will first pass through fiddler, and then the data will be displayed in the browser. In such a process, fiddler captures the entire process of request and response.
Three, Fiddler packet capture analysis
1. Left panel
Packet capture tool panel function
# : The order of HTTP Requests, starting from 1 and increasing in the order of page loading requests.
Result : the status of the HTTP response
HTTP protocol response
After receiving and interpreting the request message, the server returns an HTTP response message.
The HTTP response is also composed of three parts, namely: status line, message header, and response body
The status code consists of three digits, the first digit defines the category of the response, and there are five possible values:
1xx: Instruction information--indicates that the request has been received and continues to process
2xx: Success - Indicates that the request has been successfully received, understood, and accepted
3xx: Redirection - further action is required to complete the request
4xx: client error - the request has a syntax error or the request cannot be fulfilled
5xx: Server-Side Error--The server failed to fulfill a legitimate request
Common status codes, status descriptions, instructions:
200 OK //The client request is successful
400 Bad Request //The client request has a grammatical error and cannot be understood by the server
401 Unauthorized //The request is unauthorized, this status code must be used with the WWW-Authenticate header field
403 Forbidden //The server received the request, but refused to provide the service
404 Not Found //The requested resource does not exist, eg: wrong URL is entered
500 Internal Server Error //An unexpected error occurred on the server
503 Server Unavailable //The server is currently unable to process the client's request, and it may return to normal after a period of time
Protocol : The protocol used by the request (such as HTTP/HTTPS)
HOST : the domain name of the request address URL: the requested server path and file name, also includes GET parameters
BODY : the size of the request, in bytes
Content-Type : the type of request response
Caching : The cache expiration time of the request or the value of the cache control header
Process : The Windows process and process ID that issued the request
Comments : Comments added by the user to this session through scripts or menus
custom : A custom value that the user can set via script
2. Right panel
Statistics tab
Through this tab, users can select multiple sessions to get the total information statistics of these sessions, such as multiple requests and the number of bytes transmitted. Select the first request and the last request to get the total time taken for the entire page to load. From the bar chart, it is also possible to identify which requests take the most time, so as to optimize the access speed of the page access
inspectors inspection tab
It provides headers, textview, hexview, Raw and other ways to view the request message information of a single http request. It is divided into upper and lower parts: the upper part is for HTTP Request (request) display, and the lower part is for HTTPResponse (response) display
AutoResponse automatic response tab
The most practical function of Fiddler, it can capture online pages and save them locally for debugging, which greatly reduces the difficulty of online debugging. It allows us to modify the data returned by the server, such as making the returns HTTP404 or reading local files as the returned content .
You can set to open a certain webpage to display the content you want, such as grabbing Baidu links, click add rule, and the settings are as follows: