Skip to content

5.0.0

Compare
Choose a tag to compare
@kelunik kelunik released this 08 Oct 16:41
· 27 commits to 5.x since this release
v5.0.0
0347699

Stable release compatible with AMPHP v3 and fibers! 🎉

As with other libraries compatible with AMPHP v3, most cases of parameters or returns of Promise<ResolutionType> have been replaced with ResolutionType.

  • Request instances are mutable now and can no longer be reused.
  • Removed cloning of request attributes – You can use any value in attributes now.
  • Request now extends HttpRequest from amphp/http, gaining methods to get and set query parameters on the request instead of needing to manipulate the URI object directly.
  • Renamed header methods using the term "raw" to use "pairs" instead, e.g., getRawHeaders()getHeaderPairs(), parseRawHeaders()parseHeaderPairs()
  • Changed timeout unit from milliseconds to seconds (like timers in the event loop)
  • Removed UnprocessedRequestException, use Request::isUnprocessed() instead.
  • The EventListener interface has been reworked and event listeners can be registered with HttpClientBuilder::listen() now to automatically apply to each request instead of only being registered on specific requests.
  • Replaced FormBody with new Form API
    • Repeated form fields are no longer sent in PHP specific encoding, i.e. appids=30&appids=20 instead of appids%5B0%5D=30&appids%5B1%5D=20 (#340)
      If you need the previous names, add [] to the name of your field.
  • Replaced RequestBody with new HttpContent API
    • Added BufferedContent
    • Added StreamedContent
    • Removed Body\FileBody
    • Removed Body\FormBody
    • Removed Body\JsonBody
    • Removed Body\StreamBody
    • Removed Body\StringBody

There are no changes compared to 5.0.0 Beta 17.