Skip to content

roymithun/ExploreOkHttp

Repository files navigation

ExploreOkHttp

An exploratory console application written in kotlin to showcase how to use OkHttp a modern applications HTTP client.

What can you find?

  • 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)

OkHttp Interceptor design

Demo for network caching using interceptors

Web Sevice

Dependencies

  • 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.

References

About

A exploratory project for OkHttp networking client

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages