Retrofit — Overview
Sep 10, 2022
What is Retrofit?
The official website states, “Retrofit is a type-safe HTTP client for Java and Android”.
In detail, Retrofit transfers your HTTP API into a Java Interface. It means you need to declare a Java interface to represent your API.
Essential features of Retrofit are:
- Annotations are used to describe HTTP requests.
- Retrofit uses OkHttp as a networking layer and is built on top of it.
- Retrofit automatically serializes the JSON response using POJO. (using converter)
- Retrofit allows you to make both synchronous and asynchronous requests to APIs.
- It is highly customizable based on the requirement and use cases.