I am using Retrofit with the OkHttp Client and Jackson for Json Serialization and want to get the header of the response.
I know that i can extend the OkClient and intercept it. But this comes before the deserialization process starts.
What i basically needs is to get the header alongside with the deserialized Json Object.
With Retrofit 1.9.0, if you use the Callback asynchronous version of the interface,
Then your callback will receive a
Response
objectWhich has a method called
getHeaders()
For Retrofit 2.0's interface, you can do this with
Call<T>
.For Retrofit 2.0's Rx support, you can do this with
Observable<Result<T>>