* (in-progress) Support gzipped bodies as a networkInterceptor
* Fixed buffer cloning, added test for a still-unsupported encoding (Brotli)
* Avoid try-with-resources and too-long lines to appease build checks
* Fixed method name typo
* Added suggested comma between byte and gzipped-byte count
* Account for added comma in test
* Use buffer.writeAll to ensure all body content is read
* Indentation consistency
* Added test to confirm response body remains valid
* Update to new Gradle dependency configurations
Signed-off-by: shaishavgandhi05 <shaishgandhi@gmail.com>
* Add note for "api" usage
Signed-off-by: shaishavgandhi05 <shaishgandhi@gmail.com>
* Remove note on implementation vs. api depenedency
This library is a provided dependency and is not necessary to be included
by OkHttp users.
This currently covers the okhttp and okhttp-logging-interceptor modules
only. It does not cover the 'internal' package in OkHttp, or its test cases.
We can add those as needed.
As-is it throws unchecked exceptions on unexpected charsets. This is a problem
because it can cause a misbehaving webserver to crash the client.
I don't expect this to break existing clients; returning 'null' has always
been a possibility; it's just returned in more cases.
BridgeInterceptor does some basic header management and implements gzip
on responses.
CacheInterceptor implements HTTP response caching.
ConnectInterceptor takes the StreamAllocation that's already allocated
and uses it to create an HttpStream.
I'm currently keeping these as longs. That's easy an unambiguous, but it also
feels rather primitive.
This was more work than I expected, but it doesn't seem particularly risky.
It's also potentially more efficient, since there's fewer places where we're
converting from string to long and vice versa.
Closes: https://github.com/square/okhttp/issues/2035
Avoid using System.out.
Use the best logging implementation on the host platform. On Java this is
java.util.logging. On Android it's Android.util.Log.
Closes https://github.com/square/okhttp/issues/2505