Skip to content

More Coders and HTTPClient improvements

Choose a tag to compare

@tachyonics tachyonics released this 19 Dec 20:00

This release is moving the library closer to finalized APIs for version 1.0. It has some breaking changes-

  • The execute*WithOutput APIs of HTTPClient now produce an instance conforming to HTTPResponseOutputProtocol. This is analogous to the input type HTTPRequestInputProtocol for these methods and provides access to decoded headers from the response.
  • The HTTPClientDelegate.getTLSConfiguration() function now returns an optional TLSConfiguration. If nil is returned, a client will use http rather than https.
  • The QueryCoder package has been moved to QueryCoding.
  • The HTTPClient now needs to be explicitly closed using the close() API. The wait() can be used to block until the client is completely shut down. This was a recommendation from the SwiftNIO team (@weissi).

The are also some additions-

  • The QueryCoder (now QueryCoding) package has been joined with HTTPHeadersCoding and HTTPPathCoding for encoding/decoding headers and paths respectively.
  • The HTTPClient can now be used with an existing EventLoopGroup; it may be more efficient for an application to share ELGs across clients and/or other components. This was also a recommendation from the SwiftNIO team (@weissi).