Use Fiddler to debug your mobile app background api.

Source: Internet
Author: User

Use Fiddler to debug your mobile app background api.

When we are working on mobile apps (android, ios, wp, etc.), we need to perform data interaction with the server interface, In order to debug the background interface every time, you need to create a version of the app for testing based on the Development Library. In fact, you don't need to bother using the version of the official server address directly.

Here we recommend a web development debugging tool, fiddler, which not only debugs your web system, but also debugs mobile apps.

For the basic tutorial and introduction of fiddler, I will not describe it here. You can find resources on your own to learn about fiddler. Here I will recommend a series of blog posts on fiddler:

Http://www.cnblogs.com/TankXiao/archive/2012/02/06/2337728.html

A series of tutorials about fiddler by tank, basic learning, and mobile phone proxy interception.


Here I want to learn about the HOSTS of fiddler.

First, set the mobile phone proxy to your computer, you can refer to the tutorial of small tanks to set up.

Click the tools menu of fiddler and click HOSTS.

In the following box, you can set HOST forwarding rules:

Let's take a look at the official simple example:

The example shows that the first Host is the address you want to forward to and the second Host is the address you want to forward. Use at least one space interval. We recommend that you use a tab.

For example, the following example:

192.168.0.69: 8020 www.sina.com.cn

Here, fiddler will intercept the request to host www.sina.com.cn and forward it to 192.168.0.69: 8020.

Note: enter the port number here. If this parameter is not specified, port 80 is used by default. For example, www.sina.com.cn is port 80.

As follows:

For me to visit the http://www.sina.com.cn/HTML5/index.html page on the phone, fiddler forwarded the request for me (SINA Of course there is no http://www.sina.com.cn/HTML5/index.html this request, do not believe you try to visit ?)

Here is my local project:

I believe that everyone knows what I want to talk about. For a mobile app, we do not need to package and test the server separately, use the official version to test the HOST forwarding function of fiddler.

Note: fiddler can only intercept HTTP and HTTPS requests. For HTTPS, you also need to set it separately. The tutorial on small tanks described above is described. Please study it on your own.




Zookeeper
Capture webpage information using Fiddler APIs and C #

I have been using Fiddler for a long time, but I don't think it is a good idea to capture webpage information with Fiddler.

You can use WebClient to easily obtain a webpage. The code is roughly as follows:
New System. Net. WebClient (). DownloadFile ("www.baidu.com/", "baidu.htm ");
This line of code can be downloaded and saved as baidu.htm
Different from Fiddler, in this way, only one htm file is downloaded, and the corresponding js files and images are not downloaded. WebClient also has many methods, which are very convenient for intercepting web page information.

How to provide interfaces (APIS) for other programs

This COM technology can be made into gui exe, such as Word, Excel, or Service.
From CoRegisterClassObject (...), COM is a pillar of Windows, but once you understand it, you can become the boss.

Related Article

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.