Class 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 Detail

      • GzipRequestInterceptor

        GzipRequestInterceptor()
    • Method Detail

      • intercept

        public com.squareup.okhttp.Response intercept​(com.squareup.okhttp.Interceptor.Chain chain)
                                               throws IOException
        Specified by:
        intercept in interface com.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)