I have been using this tool for a long time and it has helped me a lot. Article 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 web Program How 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.
Using fiddler for performance testing http statistics view by displaying all HTTP Communication, Fiddler can easily demonstrate which pages are used to generate a page and through the statistics page (that is, the big box on the left of Fiddler) you 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 a page you requested, the total number of requests and the number of bytes 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 users 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 extensions 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 ";
}
}
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.)
In the second part, use Fiddler to check the experiment steps of updatepanel.
Start Fiddler, visit the previously written updatepanel webpage (do not use 127.0.0.1 or localhost ).
click btnin, btnintoout, btnout, and btnouttoin.
Result observation
In Fiddler, We can get five sessions. The first one is generated when the web page is opened, and the last four are generated when the button is clicked.
- In the session list, we can see that the icons of the second and third sessions are text files, and the width list shows that the Content-Type is text/plain, and the body is only several hundred bytes.
- The icons of the fourth and fifth sessions are Web pages. When you pull the width list, you can see that the Content-Type is text/HTML, and the body contains thousands of bytes.
This indicates that the buttons in updatepanel indeed reduce network traffic. However, although btn1_out is ineffective, communication is still performed.
Select the fourth session, switch to the session Inspector tag, and click "textview" in the following work bar to obtain data similar to the following:
Select the third session, switch to the session Inspector tag, and click "textview" in the following work bar to obtain data similar to the following:
Observation Summary
From this we can see that the events generated by the controls in updatepanel are not the whole webpage, but the events generated by controls outside updatepanel are the whole webpage.
Further steps
We found that when we click btnin and btn1_out, we only get a very short string of useful data. Why is there a transmission volume of several hundred bytes? Through Fiddler, we found that the data sent from the server not only includes the data we need, but also the data in the whole updatepanel. This is indeed a dangerous thing, if our updatepanel is large, you must use it with caution.