</>

Technology

Rest Assured

Difficulty

Intermediate

Interview Question

How to check API responses on mobile (Android/iOS) using a proxy tool?

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

  1. Install Fiddler on your PC
  2. Enable Allow remote computers to connect in settings
  3. Find your PC''s IP address
  4. On your mobile, set the WiFi proxy to your PC''s IP and Fiddler''s port (8888)
  5. Install the Fiddler root certificate on your mobile for HTTPS decryption
  6. Browse the app — Fiddler captures all traffic

Using Charles Proxy

  1. Install Charles on your Mac/PC
  2. Set your mobile''s proxy to your computer''s IP + Charles port (8888)
  3. Install the Charles Root Certificate on your mobile
  4. Trust the certificate in device settings (iOS: Settings > General > About > Certificate Trust)
  5. 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

Follow AutomateQA

Related Topics