Read More

Basic Authentication in Retrofit android

Retrofit is a library which is type-safe REST client for Android. Type-safe means that the compiler will validate types while compiling, and throw an error if you try to assign the wrong type to a variable.

Before Reading this blog you have to read following blog to learn the basic knowledge of the Retrofit,

Using Retrofit library to make Http Requests

How to add Basic Authentication

Step 1: Make an interface,


Step 2: Create the AuthToken

Step 3: Create the Retrofit Client,

Step 4: Make your call,

call the Api with Basic Authorization,

Thanks for reading this blog, You have any questions or problems comment below.

Happy Coding. Stay Super.








. . .

Comment (1)

Add Your Comment

  • Igor Ganapolsky
    This is the first solution I came across on the net that shows how to send a simple authToken via Retrofit GET request. Thanks!
  • css.php
    Hire Us!
    Brief us about your requirements and we'll get back to you.
    Woo! Hooy!
    We have just recieved your project brief and our expert will contact you shortly.
    Send Again