When doing the interface test of mobile phone or mobile app, we need to get the interface document from the developer, the interface document should include the complete function interface, interface request method, interface request URL, interface request parameter, interface return parameter. If the current project does not have an interface document, you can use Fiddler to check the app for a packet capture. The app is manipulated on the phone, and then the corresponding network interaction information can be crawled in the Fiddler (a feature may be designed to interact with multiple interfaces). In the crawled information, we can see the interface request method, interface request URL, interface request parameter, interface return parameter. Here's how to use Fiddler to grab a bag for your phone app:
Fiddler official: http://fiddler2.com/
After installation, open the interface as follows:
The description of each label is not described here, only the action to grab the packet:
1, because the principle of Fiddler grasping package is through the agent, so the terminal needs to be tested and installed fiddler computer in the same LAN.
2. Open Fiddler remote Connection, Fiddler main Menu Tools, Fiddler options...-> connections tab, check Allowremote computers to connect, And remember that the port number is 8888, and so on will be required when setting up the phone agent. After setting up, restart the fiddler to ensure the settings are in effect. Settings are as follows:
3. Check the computer IP and enter ipconfig in cmd:
4, set the agent on the phone side
Set-wlan, locate the connected WiFi long press, select Modify Network:
Then tick the advanced option, select Agent for Manual, fill in proxy server for own computer IP, port fill in just remember 8888:
Here is an example of an Android phone, if it is an iphone, you can configure the HTTP proxy directly in the corresponding WiFi settings.
5, now you can start to grab the bag:
To operate the app on your phone, you can see the corresponding network request information from the Fiddler:
6. In the Composer tab on the right, you can define and send a network request:
We can also directly drag the left caught network request directly into the composer and then make the appropriate changes to test the function of the interface under different parameters is normal.
7, in the filter tag we can set different filtering rules to filter the captured packet:
For more fiddler tutorials, refer to the website: http://kb.cnblogs.com/page/130367/
Use Fiddler to grab a bag for your mobile app