Releases: todd-elvers/pretty-okhttp
Releases · todd-elvers/pretty-okhttp
v4.0.0
After using this in the wild for quite a while v4 has finally arrived with some much needed improvements:
- Default behavior for non-200 responses has changed:
- No exception is thrown for 300's
HttpClientException
is thrown for 400'sHttpServerException
is thrown for 500'sNoResponseException
is thrown if the endpoint doesn't respond at all
- EXPERIMENTIAL: We can now differentiate between
ReadTimeout
s andConnectTimeout
s by catching theNoResponseException
and calling itsisConnectTimeout()
orisReadTimeout()
methods- This behavior is considered experimental due to the fact that OkHttp does not yet support differentiating these two scenarios. In the mean time, after some extensive testing, I have implemented my own logic to cover these scenarios. This feature is incubating and will hopefully be stable by the next major release.
- The body of the response in
HttpResponse
is now stored as a byte array since not all HTTP requests returnString
s (duh) - The body of the response is now retrievable from
HttpResponse
as either aOptional<byte[]>
or as aOptional<String>
- It is now possible to customize how non-200 responses are handled by overriding
handleNon200Response
in your class that implementsHttpRequestHandling
- It is now possible to disable exception throwing for non-200 level responses by overriding
isNon200ResponseExceptional()
and returning false in your class that implementsHttpRequestHandling
- Fixed bug where
HttpResponse
implementedHttpRequestHandling
HttpResponse
has been trimmed down to reduce memory overhead & duplication
v3.0.0
Change Log:
- Changed method names in
HttpResponse
to be clearer - Fixed bug where
HttpResponse
erroneously implementedHttpRequestHandling
- Improved documentation
v2.1.0
Change Log:
ServiceUnavailableException
now contains the following methods:wasConnectTimeout()
- for detecting connect timeoutswasReadTimeout()
- for detecting read timeouts
- Corrected some spelling mistakes
- Simplified JSON date parsing logic
- All date parsers now throw the same exception
- Removed need for redundant class declaration inside of date parsers
- Changed integration tests to unit tests w/ mock webserver
- Added more tests
v2.0.1
Change Log:
- Switched to Vavr's immutable types
- Added more tests
- Added more documentation
- Removed unused code
v2.0.0
- Restructured code to reduce duplication and allow for easier customization
- Added support for serialization & deserialization of
LocalDateTime
objects
v1.0.1
Added the necessary Gradle magic so sources & javadocs are included with the artifact.
v1.0.0
First release of the library, hurray!
Classes of most interest to you:
- HttpRequestHandling
- JsonMarshalling
- GETRequestHandling
- POSTRequestHandling
Please create an issue if you experience a bug or have a feature suggestion!