1. Fiddler Introduction
Fiddler is an HTTP protocol debugging agent tool written using C #. It supports numerous HTTP debugging tasks, can record and check all the HTTP communication between your computer and Internet, can set breakpoints, see all the "in and Out" Fiddler data (COOKIE,HTML,JS,CSS, etc.).
This article is fiddler introductory tutorial, mainly introduces fiddler download installation, HTTP interface packet capture analysis and simulation request method.
The operating environment is a Windows 7 system, and the Fiddler version is 4. (Fiddler has. NET 2.0 and. NET 4.0 versions, select the appropriate version depending on your system. NET Framework version) 2. Fiddler installation 2.1 website Download
Address: Https://www.telerik.com/download/fiddler/fiddler4 2.2 Installation Steps
Double-click FiddlerSetup.exe to complete the installation 2.3 boot fiddler
Start Menu Locate Fiddler 4 or locate the Fiddler.exe in the Fiddler installation directory and run 3. Fiddler configuration
You first need to configure the Fiddler crawl HTTPS request: Open Fiddler configuration item:tools–> Options
Open the configuration item HTTPS, tick "Capture HTTPS connects" and tick "Decrypt HTTPS traffic", and select "Yes" when the Install Certificate dialog box pops up. If you need to listen for an HTTPS request for an untrusted certificate, you need to tick "Ignore Server certificate errors (unsafe)".
4. Parsing HTTP request 4.1 HTTP Message structure Introduction 4.1.1 Request message
Request message is divided into 3 parts, the first part is called Request line, the second part is called the request header, the third part is the body. There is a blank line between the header and the body, and the structure is as follows:
Where the method in the first line represents the request methods, such as "POST", "GET", Path-to-resoure represents the requested resource, and Http/version-number represents the version number of the Http protocol. When the "GET" method is used, the body is empty
4.1.2 Response Response Message
And the structure of the request message is basically the same, the structure of the response response message is also divided into three parts: the first part is called Response line, the second part is called the response header, the third part is the body. There is also a blank line between the header and the body, as shown below:
Http/version-number represents the version number of the HTTP protocol, STATUS-CODE and message indicate HTTP response status codes and text messages, common to have OK, 302 Found, 403 forbidden,404 not found,500 Internal Server error, and so on. 4.2 Analyzing the Get interface 4.2.1 Request Example
After we run fiddler, use Chrome browser to open Baidu home page, and search keywords fiddler
4.2.2 View Get requests
At this point fiddler will crawl all browser HTTP requests and click on any request to see details, including protocol type, url,client and cookie information.
If you open Baidu homepage, the HTTP request content is as follows:
After entering the search term fiddler, Baidu searches for HTTP requests as follows (you can see the request key parameters: Wd=fiddler):
Click on the right raw View request details: protocol type, request URL, parameters, headers, etc., where the Get type HTTP interface parameter is in the request URL in the Key=value form, with multiple parameters separated by &
4.2.3 View Get response
Click Raw at the bottom right to view detailed responses, including status Line,headers and body three sections
4.3 analyzing the Post interface 4.3.1 Request Example
After we run fiddler, use Chrome browser to open Baidu homepage, click "Login" button, enter the username password and complete the login
4.3.2 Viewing Post requests
In Fiddler, click on the left request to view this login request information
Click on the right side of raw to view POST request details, including request line,headers and body three
4.2.3 Viewing Post responses
Click Raw at the bottom right to view detailed responses, including status Line,headers and body three.
5. Simulate HTTP request 5.1 to open the Debug page
Run fiddler, open right composer
5.2 Impersonation GET request
Get request is relatively simple, fill in the URL and necessary headers information, such as we simulate Baidu search word Lovesoo, the process is as follows:
Select the interface type is get, fill in Url:https://www.baidu.com/s?wd=lovesoo, then click Execute to execute
Click on the GET request on the left side of fiddler to see the details of the request and response:
5.2 Analog POST request
Here we choose a relatively simple post interface, blog Park home page to get the editor of the recommended article Editor_pick_count field interface:
This interface only needs to pass in a parameter that is the article URL, the process is as follows:
Select the interface type is post, fill in the Url:https://www.cnblogs.com/aggsite/editorpickstat, fill in {"url" in Request body: "http://www.cnblogs.com/ Hohoa/p/7739271.html "}, then click Execute to execute
Click the POST request on the left side of fiddler to see the details of the request and response:
This completes the fiddler introductory tutorial, from software download installation to common Get/post type HTTP request grabbing and impersonation.
Follow-up will introduce the use of Fiddler in the mobile-side grab Package tutorial, please look forward to.