Answer
Checking API Responses on Mobile Devices
To inspect API traffic on a mobile device (Android/iOS), you use a proxy tool such as Fiddler or Charles Proxy.
What is a Proxy Server?
A proxy server is an intermediary for requests which travel from client to server and vice-versa. It can exist:
- ✓On the same machine as the client or server
- ✓On a separate machine in the network
Setup Architecture
CODE
Mobile Device (Client)
|
| HTTPS Request
↓
Proxy Server (Your PC)
|
| HTTPS Request (forwarded)
↓
App Server
Using Fiddler
- ✓Install Fiddler on your PC
- ✓Enable Allow remote computers to connect in settings
- ✓Find your PC''s IP address
- ✓On your mobile, set the WiFi proxy to your PC''s IP and Fiddler''s port (8888)
- ✓Install the Fiddler root certificate on your mobile for HTTPS decryption
- ✓Browse the app — Fiddler captures all traffic
Using Charles Proxy
- ✓Install Charles on your Mac/PC
- ✓Set your mobile''s proxy to your computer''s IP + Charles port (8888)
- ✓Install the Charles Root Certificate on your mobile
- ✓Trust the certificate in device settings (iOS: Settings > General > About > Certificate Trust)
- ✓All app API traffic will appear in Charles
What You Can Inspect
- ✓Request URL, method, headers, body
- ✓Response status code, headers, body
- ✓Response time and size
- ✓SSL/HTTPS traffic (with certificate installed)
- ✓Throttle network speed to test on 3G/slow connections
When to Use
- ✓Debugging mobile app API calls
- ✓Verifying requests sent by third-party apps
- ✓Testing with different network conditions
