banner image

Sending HTTP Request Using Retrofit

Retrofit is a most popular HTTP client for android application for API call.This library is useful for sending Get,Post,Put, & Delete method over HTTP.

We can also send the HTTP request using HTTP Client,Volley library,so the main question is,why we should use Retrofit library for this networking call?

  • Retrofit makes easier to consume Restful web service.
  • Its is very easy to configure.
  • We don't need to handle web exception.Whereas it controls all web exception.
  • It save our development time.


Before using retrofit client we have to add the dependency inside our android project.

Step 1:

  • Expand your android project and navigate to: Gradle Script > build.gradle(Module App)

  • Open the module level gradle file and paste the following line inside dependencies bracket:
     implementation 'com.squareup.retrofit2:retrofit:2.3.0'
     implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
Step 2:
These are two dependency,Retrofit and Gson converter.After adding this two line,we need to download the dependency.So click on the Sync option from the top  right side corner.
Its done.So here we successfully added retrofit library inside our project.Now we can use this library
for sending the HTTP request to API.

Sending HTTP Request Using Retrofit Sending HTTP Request Using Retrofit Reviewed by SP Tutorials on November 28, 2019 Rating: 5


  1. I found your blog on Google and read a few of your other posts. I just added you to my Google News Reader. You can also visit Android Application Development for more Metricoid Technology Solutions related information and knowledge, Keep up the great work Look forward to reading more from you in the future.

  2. I read this article, it is really informative one. Your way of writing and making things clear is very impressive. Thanking you for such an informative article. custom quickbooks mobile app

  3. It is truly a well-researched content and excellent wording. I got so engaged in this material that I couldn’t wait to read. I am impressed with your work and skill. Thanks. oracle fusion scm online training

  4. It is quite valuable for developers who are confronted with this mistake, as you precisely and concisely describe it. Similarly to your service, you can receive air-conditioning service from me. I can give specialists to remedy your problem, and you can have our experts maintain your old air conditioner. To begin, click here to receive service.


Powered by Blogger.