How to Monitor Networks Request in IOS App

Muneef M
Intercept.Rest
Published in
2 min readSep 29, 2018

In this Post, Let’s see how we can Monitor and Debug network request in IOS swift apps.

In this demo, Swift 4.1 is used.

  • Let’s start by creating a new IOS swift project.
  • Now open Storyboard and create a new button and connect it to the ViewController by creating an action function.
  • Now let’s create a method called requestData() in which we will write all the network codes.
  • Let’s use session.dataTask()
  • Now let’s go create a URL.
  • Goto Intercept.rest and create a new Intercept account.
  • Create a new Interceptor by giving endpoint URL as the Desired API URL and click on create’ Button.
Creating a New interceptor
  • Now copy the new URL which has been generated.
The URL which has been generated using interceptor
  • Now open your code and paste the newly generated URL as the value of constant URL and run the app.
  • Press the button we created and meanwhile, check your interceptor dashboard.
  • Now you can Monitor all the network requests. Press the ‘expand’ Button to see the full JSON response.
Full code of ViewController.swift

Intercept.rest lets you debug and monitor API requests and responses. It is similar to the Network tab in Chrome Developer Tools but works for any API: mobile apps, web hooks, frontend etc.

--

--