How app Development leverages Fidder to simulate data without API interface implementation and continue to develop

Source: Internet
Author: User
Tags fiddler2

believe that the app development many times, are waiting for the background out of the interface, to get data debugging errors. As everyone knows, we can not wait, as long as there is a good interface to define the document , with tools to do, their own simulation data return ~

The following is mainly in the project team development process, the use of Fidder, explore the summary of experience.

first, Preliminary introduction and pre-preparation1, grasping the package tool introduction grasping contractor has a lot, the following one of the most commonly used tools do not briefly introduce the firebug:web most commonly used debugging tools, but for the analysis of HTTP request details, not strong enough. The ability to simulate HTTP requests is not enough, and firebug often requires "No refresh modification", and if the page is refreshed, all modifications are not saved. Wireshark: General-purpose grab tools, more powerful than fiddler, more messages, such as in the verification of anti-cheating information, anti-cheating Pingback message with fiddler did not catch, with Wireshark caught. Fiddler:httpwatch and Firebug are familiar to most front-end developers, but HttpWatch can capture all the data from each HTTP request, but cannot modify the returned data, although Firebug can modify HTML and CSS. However, the parameter values of the HTTP request and the data returned by the CGI cannot be interfered with when debugging the CGI interface. Fiddler as an HTTP debugging agent, not only can record all the HTTP communication between the client and the server, but also can modify the request data and return data, also called "Construction request" and "simulated response". In addition, the addition of the Willow plug-in Fiddler can also: statistics packets, modify host, request redirection, encoding conversion, low-speed simulation, breakpoint debugging, and filtering HTTP requests ... Fiddler contains a powerful event-based scripting subsystem and is capable of using the. NET Framework language extension 2. DownloadAccording to the. NETFramework version 2.0 or 4.0 download Fiddler2 or fiddler4 can be directly Baidu download, or the officer network download: Http://fiddler2.com/get-fiddler Installation: I agree-> Install 3. Configure crawl HTTPSTools->fiddler Options->https tab, tick the checkbox in front of "Capture HTTPS connects" and "Decrypt HTTPS traffic", then click "OK" Check to listen to HTTPS request and response to the Ps:decrypt HTTPS traffic is the meaning of decrypting HTTPS traffic, check to see the HTTPS content, if the certificate will not lead to, may cause some applications can not connect, some pictures can not display the problem 4. Configure Allow remote connectionTools, Fiddler options-> Connections tab, select the checkbox in front of allow remote computers to connect, and then tap the OK setting, then you can listen to the mobile phone that set up the agent. , note that restarting Fiddler after Setup takes effect 5, mobile phone settings agent, the IP of this machine can get the native IP through the ipconfig of cmd command, or hover the mouse directly on online (the small screen when online will be collected), such as (mobile phone and computer preferably the same WiFi or the same network segment) do not need to open the hot spot to connect, Just need the phone and install the Fiddler pc under the same wifi, the phone is connected to WiFi. Different phone settings differ, to my Nubian phone/iphone6p For example, note that the default port of fiddler is 8888, not 8080 is set to open a few apps, to see if the connection is caught, not caught is probably the agent you just set not saved 6. Install Fiddlerroot certificate(After installing the certificate will be able to catch most of the content of HTTPS) in the mobile browser input ip:8888, such as, click the bottom of the blue WordFiddlerroot Certificate(Note: The phone does not set the lock screen password will let you first to set the password) second, the interface introduction 1, the meaning of various icons in fiddler 2, grasping the bag is the most basic application of Fiddler, take this blog as an example, after starting fiddler, enter Http://www.cnblogs.com/cingchen in the browser type enter, the HTTP request captured in the Fiddler Web session interface is as follows: Additionally, Note the host field of the request. You can see a response from a subdomain of multiple api.ad.cnblogs.com, stating that in the architecture of a large web site, many subdomains are required, which may be used solely for caching static resources, or specifically for the media resources, or for data statistics 2, the layout of Fiddler main interface is as follows:

The main interface consists of four commonly used blocks:

1.Fiddler menu bar, green section. This includes capturing HTTP requests, stopping capture requests, saving HTTP requests, loading local sessions, setting capture rules, and so on.

2.Fiddler toolbar, red section. Includes fiddler actions for the current view (pause, clear Session,decode mode, clear cache, and so on).

3.web session panel, yellow area, mainly fiddler crawl to each HTTP request (each called a session), mainly contains the requested URL, protocol, status code, body and other information, the detailed field meaning as shown:

4. Details and data statistics panel .

Specific statistics for each HTTP request (such as the number of bytes sent/received, the Send/Receive time, and a rough count of the time spent accessing the server around the world) and packet analysis. such as the Inspector panel, provides headers, TextView, Hexview,raw and other ways to view the request message of a single HTTP request:

Under the composer panel, you can simulate the process of sending data to the appropriate server (yes, this is the basic principle of the irrigation robot, or it can be a way of partial HTTP flood).

You can also paste the requested raw HTTP headers to achieve the purpose of the impersonation request:

The filter tag can be used to filter HTTP requests by setting the Fiddler filtering rules. The simplest example: Filter the intranet HTTP request to crawl only the Internet HTTP request, or filter the corresponding domain name of the HTTP request. Fiddler filters are very powerful, can filter requests for specific HTTP status codes, can filter HTTP requests for specific request types (such as CSS requests, image requests, JS requests, etc.), and can filter requests with a request message greater than or less than a specified size (byte):

More filter rules require a step-by-step digging.

Three, the general function introduction

1. Change the hostFiddler can change the host directly, do not need to restart the phone to take effect immediately, and for iOS is also supported, can be in the formal environment/test environment to switch back and forth, very convenient tools->hosts ... 2, Analog weak network environment, speed limitRules→performances→simulate Modem Speeds. When you tick, you'll find that your network is slowing down a lot. As to slow down after the network speed is how much, then by Customrules.js in the following program control (CTRL+R): ... var m_simulatemodem:boolean = True;...if (m_simulatemodem) {// Delay sends by 500ms per KB uploaded.osession["request-trickle-delay"] = "$";//delay receives by 150ms per KB Downloade d.osession["Response-trickle-delay"] = "150";} ... The algorithm is 1000/download speed = time to delay (milliseconds), such as 50kb/s need delay20 milliseconds to receive data, so according to the network speed you need to modify the above values. "Note": After the archive, the original already checked simulate modem Speeds will be uncheck, need to rules→performances→simulate modem Speeds Check, but also must be careful to disable the browser proxy plugin, and restart the browser to take effect after the modification is complete. 3, Break point (will be all the request break point)Before requests F11 Modify the request data after responses ALT+F11 Modify the response result breaks on Response Click on the place where the response will break point run to completion modify and click on the operation, the modified data will be Request/Return 4. Composer Simulation requestAll HTTP requests can be simulated, the specific parameters can be written in raw, and then click Execute to execute the mock request 5, Autoresponder automatic responseCan accurately handle the captured data, such as Break point (*bpu/*bpafter), directly return the written return value (Find a file ...) such as 6, Testwizard transcoding 7, Replay re-simulate the same request, shift+ left button can generate n the same request, can be used for a simple stress test 8, Shortcut command (Alt+q can direct focus to the command line)Request Breakpoint: Bpu 192.168.0.1 Clear Request Breakpoint: BPU response Breakpoint: Bpafter 192.168.0.1 Clear Response breakpoint: Bpafter stop/start catch local request: Stop/start Replace request address: Urlreplace Www.zhuaqianmao.com 121.41.58.3 (replace the request of Zhuaqianmao with 58.3)
Release all breakpoints: Go/g Select all requests for this host: @118.178.168.129 All request types are breakpoints for XXX: BPV (BPM) xxx (such as post/get) clears all requests: Clear/cls exit Fiddler: Quit more commands to refer to: http://www.xuanfengge.com/fiddler2-shortcut-command-tutorial-translation.html
9, change the UA, you can set all the request default User-agent

How app Development leverages Fidder to simulate data without API interface implementation and continue to develop

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.