com.payu.sdk.api.http.interceptor.LoggingInterceptor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of api-client Show documentation
Show all versions of api-client Show documentation
A fresh implementation of the PayU API Client for Android
The newest version!
package com.payu.sdk.api.http.interceptor;
import com.payu.sdk.api.log.ApiLog;
import com.squareup.okhttp.Interceptor;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.Response;
import java.io.IOException;
import static com.payu.sdk.api.log.Logger.getLog;
public class LoggingInterceptor implements Interceptor {
private static final ApiLog logger = getLog();
@Override public Response intercept(Chain chain) throws IOException {
Request request = chain.request();
logger.log(String.format("Sending request headers %s", request.headers()));
Response response = chain.proceed(request);
logger.log(String.format("Received response with code: %s \n headers: \n %s", response.code(),
response.headers()));
return response;
}
}