HTTP debugging tool: fiddler Introduction

Source: Internet
Author: User
ArticleDirectory
I have been using this tool for a long time, and it has helped me a lot. Today I have translated Microsoft articles, so that more friends can come to understand this good tool, this is also the first time I have translated an article. If this is not the case, please correct me more.
Introduction:

Have you ever wondered whether your webProgramHow does one interact with IE? Have you ever encountered some strange performance bottlenecks that you cannot solve? Are you curious about the cookies sent to the server and the cached content that you downloaded?

Fiddler website and: http://www.fiddlertool.com/Fiddler/dev/

Microsoft's Fiddler can help you answer the above questions. In addition, it is also an HTTP debugging proxy that records all HTTP Communication between your computer and the Internet, fiddler can also enable you to check all HTTP Communication, set breakpoints, and all "In and out" data (such as cookies, HTML, JS, CSS, and other files) of fiddle, these can make you modify the meaning randomly ). Fiddler is simpler than other network debuggers because it only exposes HTTP Communication and provides a user-friendly format.

Fiddler contains a simple but powerful JScript-based event script subsystem. It is very flexible and supports many HTTP debugging tasks. Fiddler is written in C.

..... Next is a piece of nonsense. For how to install it, you only need to go one way to next. In this section, I will skip and go straight to the topic.

Running fiddler

When you start Fiddler, the program will act as a system proxy for Microsoft Internet services. You can verify that Fiddler is intercepted correctly by checking the Proxy Settings dialog box. Click iesettings, tools, LAN Settings, and advanced.

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. In this way, you can understand that fiddler has many functions!

When you disable Fiddler, it automatically removes it from the system registry. In other words, once you disable Fiddler, it will not occupy the pitfalls.

The following is a fillder user interface. You can refer to its functions.

HTTP statistics view for Performance Testing Using fiddler

By displaying all HTTP communications, Fiddler can easily demonstrate which pages are used to generate a page. By using the statistics page (that is, the big box on the left of Fiddler), users can easily use multiple choices, to get the "Total weight" (page files and related JS, CSS, etc.) of a Web page. You can also easily see the total number of requests on a page you requested, and how many bytes are converted.

In addition, by exposing the HTTP header, You can see which pages are allowed to be cached on the client or proxy. If a response does not contain the cache-control header, it will not be cached on the client.

Debug with fiddler

Fiddler supports breakpoint debugging. When you choose beforerequest in the software menu-rules-Automatic breakpoints, or when these request or response attributes match the target criteria, fiddler can pause HTTP Communication and allow requests and responses to be modified. This function is very useful for security testing, and can also be used for general functional testing, because allCodePaths can be used for drills.

Session check

You can create an HTTP request manually in builderpage (that is, the third of the tab on the Right of Fiddler, requestbuilder ), you can also use the drag operation to move an existing request from the session List to the builder page to execute the request again...

Fiddler Extension

Fiddler can be extended using. NET Framework. There are two basic mechanisms to prepare for the fiddler extension:

Customize rules and check rules.

Use scripted rules to extend fiddler

 
 

Fiddler supports the JScript. net engine, which allows users to automatically modify HTTP requests and responses. This engine can modify sessions in the fiddlerui on the visual interface, extract the errors you are interested in from the list, or remove sessions you are not interested in.

The following sample code shows how to change the page to purple when the cookie is loaded.

 
Static function onbeforerequest (osession: Fiddler. Session)
 
{
If (osession. orequest. headers. exists ("cookie ")){
 
Osession ["UI-color"] = "Purple ";
 
Osession ["UI-bold"] = "cookie ";
 
}
 
}

Extended fiddler by adding inspectors

You can add an inspector plug-in object to compile the fiddler extension in any language in. net. Requestinspectors and responseinspectors provide a standardized format or a specified (User-Defined) HTTP request and response view.

By default, the following inspectors are added to Fiddler:

Request inspectors

[RW] headers-shows request headers and status.

[RW] textview-shows the Request body in a text box. (original request body view)

[RW] hexview-shows the Request body in a hexadecimal view. (hexadecimal view of the body)

[Ro] XML-shows the Request body as an xml dom in a tree view. (The request is displayed in XML format)

Response inspectors

[RW] transformer-removes gzip, deflate, and chunked encodings for easier debugging.

[RW] headers-shows response headers and status.

[RW] textview-shows the response body in a text box.

[RW] hexview-shows the response body in a hexadecimal view. (hexadecimal view)

[Ro] imageview-shows the response body as an image. supports all. Net image formats.

[Ro] XML-shows the response body as an xml dom in a tree view.

[Ro] Privacy-explains the p3p statement in the response headers, if present. (if there is a description of the Privacy Policy in the Response Header, it will be displayed)

Source: http://fredlau21.blog.163.com/blog/static/485512622007111313059742

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.