Package io.gopluslabs.client
Class GzipRequestInterceptor
- java.lang.Object
-
- io.gopluslabs.client.GzipRequestInterceptor
-
- All Implemented Interfaces:
com.squareup.okhttp.Interceptor
class GzipRequestInterceptor extends Object implements com.squareup.okhttp.Interceptor
Encodes request bodies using gzip. Taken from https://github.com/square/okhttp/issues/350
-
-
Constructor Summary
Constructors Constructor Description GzipRequestInterceptor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private com.squareup.okhttp.RequestBodyforceContentLength(com.squareup.okhttp.RequestBody requestBody)private com.squareup.okhttp.RequestBodygzip(com.squareup.okhttp.RequestBody body)com.squareup.okhttp.Responseintercept(com.squareup.okhttp.Interceptor.Chain chain)
-
-
-
Method Detail
-
intercept
public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException- Specified by:
interceptin interfacecom.squareup.okhttp.Interceptor- Throws:
IOException
-
forceContentLength
private com.squareup.okhttp.RequestBody forceContentLength(com.squareup.okhttp.RequestBody requestBody) throws IOException- Throws:
IOException
-
gzip
private com.squareup.okhttp.RequestBody gzip(com.squareup.okhttp.RequestBody body)
-
-