http Debugging Tools: Fiddler
Fiddler Tool Introduction A
(Original address: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwebgen/html/IE_IntroFiddler.asp)
This tool I have been used for a long time, and for my help is also very large, today I translated the Microsoft article, so that more friends to understand this good tool, but also my first translation of articles, inappropriate place please everyone to correct.
Introduced:
Have you ever wondered how your Web app and IE interact with each other? Have you encountered some strange performance bottlenecks that you can't solve? Are you curious about the cookies that are sent to the server and those that you have downloaded that are marked as cacheable?
Fiddler official website and download address: http://www.fiddlertool.com/Fiddler/dev/
Microsoft's Fiddler can help you answer the above questions, not only that, it is an HTTP debugging agent, it can record all the HTTP communication between your computer and the Internet, Fiddler can also let you check all HTTP traffic, set breakpoints, and fiddle all the " In and Out "data (refers to cookie,html,js,css and other documents, which can make you arbitrarily modify the meaning). Fiddler is simpler than other network debuggers because it exposes only HTTP traffic and provides a user-friendly format.
Fiddler contains a simple yet powerful, JScript. NET Event Script subsystem, and he is very flexible and can support numerous HTTP debugging tasks. Fiddler is written in C #.
。。。。。 Next is a big piece of crap about how to install, just go all the way to next. I'll skip the passage and cut to the chase.
Running Fiddler
When you start Fiddler, the program will take you as a System agent for Microsoft Internet Service. You can verify that the fiddler is properly intercepting the Web request by checking the Proxy Settings dialog box. The operation is this: Click IE settings, tools, LAN settings, and finally click Advanced.
As a System agent, all HTTP requests from Microsoft Internet Service (WinInet) will go through fiddle before reaching the target Web server, and all HTTP responses will flow through fiddler before returning to the client. In this way, you can understand fiddler a lot of role.
When you close the fiddler, it is automatically removed from the system registry, in other words, when you shut down the fiddler, you don't take a dump in the manger.
Below, is a Fillder user interface, you can refer to its function.
use Fiddler to do performance testing
HTTP Statistics View
By displaying all of the HTTP traffic, fiddler can easily demonstrate which users can use to generate a page, through the statistics page (that is, the big box on the left of the fiddler), it is easy for the user to get a Web page "total weight" (paging file and related JS, CSS, etc.) you can also easily see a page of your request, how many times a total request, and how many bytes have been converted.
In addition, by exposing the HTTP headers, users can see which pages are allowed to be cached on the client or proxy side. If a response does not contain a Cache-control header, then he is not cached on the client.
Use Fiddler to debug
Fiddler supports breakpoint debugging concepts when you select Beforerequest in the menu-rules-automatic breakpoints option of the software, or when these request or response attributes can match the target's criteria, Fiddler is able to suspend HTTP traffic, allowing for modification of requests and responses. This functionality is useful for security testing and, of course, can be used for general functional testing because all code paths can be used to drill.
Session Check
Users can create an HTTP request in a builderpage (that is, the third of the tab on the right side of Fiddler, Requestbuilder), or you can use a drag-and-drop operation to move an existing request from the session list to Builder page to execute this request again ...
Fiddler Extension
Fiddler can use the. NET Framework to extend it. There are 2 basic mechanisms for fiddler extension preparation:
Custom rules, and rule checking. using scripted rules to extend fiddler
Fiddler supports JScript. NET engine, which enables users to automatically modify HTTP requests and responses. The engine is able to modify the session in the Fiddlerui in the visual interface to extract from the list the errors you are interested in, or to remove the session that you are not interested in.
The following sample code shows that the interface becomes 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";
}
}
Extend fiddler by adding inspectors
Users can join a Inspector plug-in object to write fiddler extensions using any language under. Net. Requestinspectors and Responseinspectors provide a format specification, or a specified (user-defined) HTTP request and Response view.
In the default installation, Fiddler added the Inspectors:
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. (Body's 16-in view)
[RO] Xml-shows the request body as an XML DOM in a tree view. (Presentation of requests in XML)
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. (16 in view)
[RO] Imageview-shows the response body as a 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 a description of the privacy policy is present in the response header)