It is common practice to have some kind of logging to be able to debug the communication. This will require to introduce a logging interceptor right after the actually used AuthenticationInterceptor. However in order to not close the underlying buffers, it is good to upgrade retrofit2 version (currently 2.9.0), so that response.body().source().peek() function will be introduced in class RealBufferedSource. This function allows to clone the source and that way preserve the source for later use yet be able to log the response body at the same time.
It is common practice to have some kind of logging to be able to debug the communication. This will require to introduce a logging interceptor right after the actually used AuthenticationInterceptor. However in order to not close the underlying buffers, it is good to upgrade retrofit2 version (currently 2.9.0), so that response.body().source().peek() function will be introduced in class RealBufferedSource. This function allows to clone the source and that way preserve the source for later use yet be able to log the response body at the same time.