Skip to content

Releases: todd-elvers/pretty-okhttp

v4.0.0

07 Jul 21:16
Compare
Choose a tag to compare

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's
    • HttpServerException is thrown for 500's
    • NoResponseException is thrown if the endpoint doesn't respond at all
  • EXPERIMENTIAL: We can now differentiate between ReadTimeouts and ConnectTimeouts by catching the NoResponseException and calling its isConnectTimeout() or isReadTimeout() 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 return Strings (duh)
  • The body of the response is now retrievable from HttpResponse as either a Optional<byte[]> or as a Optional<String>
  • It is now possible to customize how non-200 responses are handled by overriding handleNon200Response in your class that implements HttpRequestHandling
  • It is now possible to disable exception throwing for non-200 level responses by overriding isNon200ResponseExceptional() and returning false in your class that implements HttpRequestHandling
  • Fixed bug where HttpResponse implemented HttpRequestHandling
  • HttpResponse has been trimmed down to reduce memory overhead & duplication

v3.0.0

14 Nov 16:44
Compare
Choose a tag to compare

Change Log:

  • Changed method names in HttpResponse to be clearer
  • Fixed bug where HttpResponse erroneously implemented HttpRequestHandling
  • Improved documentation

v2.1.0

14 Nov 15:45
Compare
Choose a tag to compare

Change Log:

  • ServiceUnavailableException now contains the following methods:
    • wasConnectTimeout() - for detecting connect timeouts
    • wasReadTimeout() - 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

02 Oct 21:36
Compare
Choose a tag to compare

Change Log:

v2.0.0

10 Sep 21:20
Compare
Choose a tag to compare
  • Restructured code to reduce duplication and allow for easier customization
  • Added support for serialization & deserialization of LocalDateTime objects

v1.0.1

27 Aug 02:14
Compare
Choose a tag to compare

Added the necessary Gradle magic so sources & javadocs are included with the artifact.

v1.0.0

27 Aug 01:47
Compare
Choose a tag to compare

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!