what is fiddler.
Baidu Encyclopedia is introduced in this way-"Fiddler is a Web debugging agent." It can record HTTP requests between all clients and servers, allow you to monitor, set breakpoints, and even modify input and output data, Fiddler contains a powerful event-based scripting subsystem, and is able to use the. NET Framework language extension. ”
So no matter what you are engaged in developing, which language, as long as you want to understand HTTP, this tool is worth your understanding, and more importantly, this tool is free.
Fiddler is to monitor the network data flow of the system in the way of proxy server.
When the fiddler is started, the network traffic that occurs is relayed through fiddler, so we can see the information of the HTTP/HTTPS data stream, and we can analyze it. Fiddler also provides a range of tools to clear IE caches, request constructors, text conversion tools, and more, which is valuable for front-end development work.
installation and download of Fiddler:
Fiddler Download Address: http://www.fiddler2.com/fiddler2/
Depending on which version of the. NET framework2.0 or 4.0 that is installed on this machine. . NET Framework 2.0 corresponding download Fiddler2 . NET Framework 4.0 corresponding download Fiddler 4
If you are an early XP version of the system during installation, you will be prompted to download the. NET Framework version 2.0 or later. The installation process is very simple, the next step is good, remember must first install the. NET Framework, and then install the Fiddler, it is no longer described in detail. Monitor Switch-only two states, use the time is open, do not let ya rest. Capturing indicates snapping state
Listening type-four states to listen for all requests, listen for browser requests, listen for non-browser requests, and hide all
Command line-do not introduce, the difficult person will not, will not be difficult. I belong to the former, tragedy ...
Request List-The information for the request list has results (result), Protocol (PROTOCOL), hostname (host), Web address (URL), content size (Body), Cache (Caching), Response HTTP content type (content-type), Request Run Program (process), note (Comments), custom
Request Information-Right This blockbuster is a viewer for information about the data flow, which provides many viewing forms to view the contents of the data flow.
tell me why I use fiddler at work, How to use fiddler
Front-end engineers in the work there will always be some requirements, the code required to write a good compatibility, the need to consider the high-performance code, the requirements of the method to object-oriented, requirements ... Front-end engineers are always compatible with browsers and have a lot to say.
Condition 1: In the work developed by our front-end engineers, we want to debug a html/css/javascript file on the server. In general, we will modify the file directly, and then re-release to do the verification, which will easily affect the test environment or the stability of the build environment. Better yet, we can directly modify the file and verify it in the local development environment, and then publish it to the test environment, which will ensure the stability of the test environment, but it is more cumbersome.
Condition 2: Now my situation is that I need to debug the browser compatibility issue of the on-line product, and I have no local environment or build environment to test. If there is a bug in Firefox or Chrome that has console-supported debugging browser everything is say, but if the bug only happened in the travel, TT, the window of the world, Sogou ... This kind of browser without debugging, and you also met my current situation, then if not fiddler this tool, can only say that this is a disaster.
The Fiddler tool modifies the characteristics of the HTTP data, and we make it easy to modify and validate it based on the production environment, and then release it.
The first step is to locate the debug file and download it first. If you find a file in the page has a problem (html/css/javascript), then we need to do is to download it to local (if there is local local so you can skip this step), downloaded to the local file occasionally garbled situation, We recommend that you first clean up the browser cache or adjust the registry (Fiddler2 Chinese garbled problem). The second step, Fiddler-autoresponder appearance, turn on this function. Open the Autoresponder label settings. You can see that there are three selection boxes on the interface, the first is to turn on or off the automatic redirection function, we can add the redirection rule below, the second box is ticked, the mismatch request can pass, and does not affect those requests that do not meet our processing conditions.
The third step is to create a redirect rule that redirects the HTTP request for this JS to a local file. Select the file you just located, add the rule via the "Add ..." button, or drag it directly over.
Fourth, select the file you just saved or replace the file, as a replacement for the content of this request.
The fifth step, you debug or not debug, it is there-will only ask for your local selection of the file. So, you can do whatever you want to change. Refresh the page and you'll see the alert. Summary: Although the introduction of the total is divided into 5 steps, in fact, as long as the habit is very casual can be debugged. Fast front-end debugging is actually simple.
Fiddler2 Chinese garbled problem
Author Eric Lawrence later launched a powerful version of--fiddler, probably the best HTTP analysis software available at the moment. As free software, many aspects are better than HttpWatch, HTTP Analyzer. Of course, commercial software also has the advantages of fiddler, this article is not the main thrust of comparison. Only said Fiddler, the advantages are: In addition to tamper with the request, can also tamper with response; can set various filters, run in a separate way, not only for IE, good extensibility, support scripts and plugins.
There are a lot of articles on the Internet, not much to say in this. But none of these articles mentions a problem: for some Chinese websites, the Chinese parameters in the POST request cannot be fiddler correctly. The specific performance is: These sites are encoded with gb2312/gbk/gb18030, such as the POST request contains the word "Chinese", in the fiddler TextView Inspector Display as "" ("Chinese" GBK code), In the WebForms inspector is shown as garbled, because fiddler the UTF-8 decoding them according to the. Conversely, setting the parameter to Chinese value in WebForms inspector will be sent out by fiddler with UTF-8 encoding to cause an error. Actually, it's not Fiddler's fault, it's the turtle. The website does not specify a character set in the header.
Send a letter to the author to inquire, quickly got a reply: Open the Registry Editor, find Hkcu\software\microsoft\fiddler2\, add a string value in it, called headerencoding, the value is set to the default encoding. It is recommended to set the GB18030. Then remember to restart Fiddler to take effect.
Win7
1. Windows button +r
2. Enter Regedit + carriage return + Yes
3, Hkey_current_user\software\microsoft\fiddler2
4, right-click New, select String Value plus headerencoding and then value input GBK