Consider updating docs/readme to addNetworkInterceptor() instead of addInterceptor()
See original GitHub issue⚠️ Is your feature request related to a problem? Please describe
I recently had an issue where I couldn’t see my headers in the request tab. I use chucker as an on-device replacement for chalres proxy and so not showing okhttp headers by default (like the docs show) is sub-par imo. So I’m basically turning this comment by @MiSikora into a proper feature request. https://github.com/ChuckerTeam/chucker/issues/758#issuecomment-1007020678
💡 Describe the solution you’d like
Update docs from
// Don't forget to plug the ChuckerInterceptor inside the OkHttpClient
val client = OkHttpClient.Builder()
.addInterceptor(chuckerInterceptor)
.build()
to
// Don't forget to plug the ChuckerInterceptor inside the OkHttpClient
val client = OkHttpClient.Builder()
.addNetworkInterceptor(chuckerInterceptor) // use network interceptor if you want to show all network traffic (like a proxy would)
// or
.addInterceptor(chuckerInterceptor) // use an application interceptor if you want to show... idk why you would want an app interceptor honestly. 🤷♀️ )
.build()
📄 Additional context
As per the okhttp docs… Network Interceptors “Observe the data just as it will be transmitted over the network.” so to me… chucker is a library that is made to replace a proxy a proxy is used to observes data over the network why recommend/guide users towards using an application interceptor?
Anyway. I just hope some minor changes to docs will help someone make an informed decision when adding the library, vs just following the docs for adding an app interceptor.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (3 by maintainers)
Top GitHub Comments
I didn’t open a PR because I didn’t know if there were some advantages to app vs network (you highlighted a good one though “not polluting chucker with redirect responses”
I can try to look up some more pros and cons to try to compare them at some point in the future.
I found out today that charles also shows redirects and so im okay with them because i want chucker to replaces charles. 😄