Retrofit 2 — Debug and Compare Requests with RequestBin

One of the most commonly asked questions in our email inboxes and comment sections is about API requests not working. The request works on another client (iOS app, Postman tool, …), but not with Retrofit on Android.

Our usual suggestion is to add logging via OkHttp interceptor or via Stetho and to take a look at the request headers, encoding, and payload. This gives a chance to check whether the request is different from the other client.

Retrofit logging allows you to inspect how the request is going to the server, but it's hard to compare it to the request of other clients. Retrofit's logging will display the payload differently than an iOS app. In this tutorial, we'll explore RequestBin as a free tool to make requests comparable across platforms and clients.

Retrofit Series Overview

Continue reading

University Enrollment Required

Future Students benefit from value packed videos and tutorials.

Enroll to receive exclusive content or sign in if you’re already a Future Student.

Enroll me for $15/mo

Explore the Library

Find interesting tutorials and solutions for your problems.