Weekly Swift articles, podcasts and tips by John Sundell.

Using Paw to test an app’s web API

Published on 02 Nov 2020

My thanks to the team behind the fantastic HTTP and GraphQL utility Paw for sponsoring Swift by Sundell last week. I thought I’d take this opportunity to tell you a bit more about how Paw can be a super useful tool for iOS and Mac developers, since it lets you easily test and debug any web API that your app is talking to.

Let’s say that you’ve started building a new feature that either requires you to download JSON from a new API endpoint, or to connect to some form of external web API. Using Paw, you can easily make test requests to those endpoints, which will quickly get you access to all sorts of useful information — including headers and other kinds of metadata, but perhaps most importantly, what kind of response data that the server will send you.

For example, here I’m making a call to GitHub’s search API, which shows me exactly what JSON format that I can expect when making such calls within my app. That in turn lets me quickly and easily model my Codable structs and other Swift code that’ll interact with that data, and also tells me what to expect in terms of caching behavior, rate limiting, and so on:

Paw screenshot

Of course, the above example barely scratches the surface of what Paw is capable of. It supports authentication, cloud syncing, all sorts of REST requests (like POST, PUT, and so on), and it now also supports GraphQL as well. All of that, and much more, comes built into a fully native, fast Mac app that is a joy to use.

The best way to learn more is to simply try it out for yourself. Visit paw.cloud/sundell to try Paw for free, and when you use that URL you’ll both directly help support me and my work, and you’ll also get an exclusive 20% discount if you decide to purchase Paw after trying it.