Closed nschwermann closed 9 years ago
Where are you observing the lack of request headers? We're sending 'em
In logcat it only shows the header that I am adding with the intercepter, also the server isn't sending back the response body gzipped unless I add the accept-encoding header myself in the intercepter and then I also see it in logcat.
Edit: The transparent headers should show up in the logs with log level headers correct? If my log messages or complete source can help I am happy to share them.
On Thu, Jun 25, 2015 at 4:50 PM, Jesse Wilson notifications@github.com wrote:
Where are you observing the lack of request headers? We're sending 'em
— Reply to this email directly or view it on GitHub https://github.com/square/retrofit/issues/921#issuecomment-115409024.
Nathan Schwermann 785-312-0080
If you are logging with Retrofit you will never see this in action. It happens in the HTTP client and truly embodies the word of "transparent" to Retrofit.
On Thu, Jun 25, 2015, 2:52 PM Nathan Schwermann notifications@github.com wrote:
In logcat it only shows the header that I am adding with the intercepter, also the server isn't sending back the content gzipped unless I add the accept-encoding header myself in the intercepter and then I also see it in logcat.
On Thu, Jun 25, 2015 at 4:50 PM, Jesse Wilson notifications@github.com wrote:
Where are you observing the lack of request headers? We're sending 'em
— Reply to this email directly or view it on GitHub https://github.com/square/retrofit/issues/921#issuecomment-115409024.
Nathan Schwermann 785-312-0080
— Reply to this email directly or view it on GitHub https://github.com/square/retrofit/issues/921#issuecomment-115409873.
I see, it could be helpful to add an additional log level or something to reveal them for debugging purposes. I hooked though Charles and I see that they are there and that the response headers are also altered by retrofit/okhttp so this is why I thought gzip wasn't happening. Thanks for the explanation.
It is impossible to see them in Retrofit.
Ok thank you. Is there a list of all of the transparent things? Is my setting up the cookie store, cache, etc in the above example even necessary? Will I still get these transparent features when I plug okhttp into the facebook's fresco image library or is this all strictly from retrofit?
No there is not a list. Yes you need to configure those things yourself, they don't have defaults. Any code using OkHttp's API gets the transparent gzip.
I am reading everywhere that retrofit/okhttp is supposed to transparently handle various headers such as requesting gzip, setting the user agent, cookies etc. However, with this basic kotlin code below I'm not getting any request headers set other than the one I'm setting with the request interceptor. Is there something I need to do to enable this stuff?