An exploratory console application written in kotlin to showcase how to use OkHttp a modern applications HTTP client.
- Use and configure OkHttpClient.Builder to get OkHttpClient.
- Add interceptors, such as
- HttpLoggingInterceptor
- custom interceptors, serving different purposes, such as authentication, or add custom headers
- Network layer interceptor (such as to enable caching)
- Application layer network interceptor (enforce cache to be used)
- jsonplaceholder posts API is used in order to showcase API call capabilities ok OkHttp
- com.squareup.okhttp3:okhttp:4.10.0
- com.squareup.okhttp3:logging-interceptor:4.10.0
- com.google.code.gson:gson:2.9.0
[TODO] Explore authenticator use cases.
- OkHttp - official site
- mindorks okhttp interceptors - nice use cases of interceptors
- objectpartners blog on authenticator - explain in detail usage of authenticator
- baeldung okhttp interceptors
- SO - How to cache OkHttp response from Web server?
- A complete guide to okhttp

