Debug API Requests from Mobile Devices Using Postman Proxy

This post is an update of an original tutorial on Postman Proxy by our Chief Software Architect, Shamasis Bhattacharya.

Over the last few years we have seen the focus move drastically from desktop devices to mobile devices. With reports suggesting that 70 percent of all the web traffic is coming from mobile devices, the need to understand the requests from a mobile device and perceive what is happening behind the scenes while performing operations is of utmost importance to developers.

At Postman, we believe in making lives simpler for developers. Keeping that in mind, Postman is designed to help you inspect the web traffic originating from your mobile device. In this segment, we’ll see how you can do this using a proxy server. All we need is a computer (Windows/Mac), a mobile device (iOS/Android) and Postman.

What is a Proxy Server?

Proxy Server

Simply put, a proxy server is a gateway between the client and the server. In our case, we will use the mobile device as a client, and make the computer act as a proxy between the client and the server. The flow is setup in a way that the internet traffic passes through the proxy server while attempting to reach the web address you requested.

Capturing API requests from Postman Proxy

  1. To get started, we need the computer and the mobile device to be connected to the same wireless network. I’m going to use a Mac laptop and an Android smartphone.
  2. Click on the Proxy Settings button in the top menu bar.
  3. The Proxy Settings modal should show. Make a note of the port mentioned. I’ll use the default post “5555”. Select the target to capture the requests. I’ll use the “History” sidebar panel. Click on Connect.
  4. Find the IP address of your computer. You should see this in your Network settings.
  5. Configure HTTP Proxy on the mobile device. You can do this by going to Settings -> Wi-Fi and selecting the Modify Network option. Enter the computer’s IP address as your Proxy Host. Set the proxy port to the same as the port in the Postman app, i.e. 5555.

You should have everything working!

Open a browser on the mobile device or any app and keep an eye on the Postman app. I entered www.mit.edu in my Chrome for Android browser. As the browser started contacting the server, all of the calls start appearing in the Postman sidebar.

Postman captures all the calls made by the browser

Benefits of using the Postman Proxy

  • Helps you to understand the communications between the client and server. This could be useful from a security standpoint to highlight malicious requests.
  • Makes it easier to debug by pinpointing where the app crashes or throws an error.
  • Identifies behavior differences among mobile devices (based on hardware and resolutions), which help to isolate bugs seen on certain devices.

  

What do you think about this topic? Tell us in a comment below.

Comments

Your email address will not be published. Required fields are marked *



This site uses Akismet to reduce spam. Learn how your comment data is processed.

9 thoughts on “Debug API Requests from Mobile Devices Using Postman Proxy

  • Ahsan

    Hi, thanks for this article. I need to know how to track all the request from mobile native app?



  • Huiyang Shan

    How to install the Cert!?



  • Mohammad Kamrul Hassan

    i am sorry, but it seems it’s does not work in my case or may be i am doing something wrong?

    please have a look at the following image, all app shows similar message and don’t go any deeps as calling to their web server didn’t’ goes through 🙁

    https://imgur.com/z5fnbKJ

    any help please?

    best regards



    • Postman Editor

      Hi Mohammad, Thanks for reading and responding. For this issue, we recommend posting on the community forum at community.postman.com to get help from other users.



  • omar

    Great, I didn’t know that before
    thank you Jonathan 😊



  • Arunkumar

    Can we check the API calls made through some mobile APP



    • Postman Editor

      Hi Arunkumar, Thanks for reading. There isn’t a Postman mobile app, if that’s what you’re asking. Let us know if you meant a different question.



  • Vk

    Does this work with https:// requests? Not working for me



    • Meenakshi Dhanani

      Hi Vk, this works for https requests as well. It could be due to some safe browsing settings that the proxy is blocked.



You might also like: