OkHttp - Cannot add custom header

365 Views Asked by At

I want to add custom headers to my requests. I truly prepare OkHttp and Retrofit connections so that i can get response from my requests which don't want any information in header.

So when i try to add information to header via Interceptors as shown in Refrofit's documents , I can't see datas in header. I track the requests via Charles as well but not appear my datas there. Any suggestions why can't i add header and how to fix it ?

1

There are 1 best solutions below

1
On

There is network interceptor and just interceptor. maybe you use network interceptor instead regular one? don't forget to process already existing chain in interceptor ,