Retrofit Source Code Reading
Retrofit is a well known network util framework which allows the developer to declare the HTTP APIs via JAVA interfaces. This article takes a close look at Retrofit source code and explain how it works. Before we start the code study, let’s take a look at use cases provided by the library:
- Declaration of HTTP api interface via Java interface class
- support declaration of http request method
- support declaration of url path and dynamic variables in path
- support declaration of http bodies/query map/multi-form
- support customisation of http headers
- Support invocation of sync and async calls