Releases: amphp/http-client
4.0.0 RC2
This release adds support for HTTP/2 push promises.
Note: This is a pre-release, there might be breaking changes in the final stable version.
Request
now has an onPush()
method which defines a callback invoked if the server pushes resources to the client. The callback should accept three arguments: Request $request
, Promise $promise
, and CancellationTokenSource $source
. $request
is the request as generated by the pushing server; $promise
is a promise that is resolved with the Response
object containing the pushed resource; and $source
allows the push to be cancelled by the callback.
Request::getPushCallable()
returns the callback defined with onPush()
.
If no push callback is defined in a request, the client automatically refuses any pushed resources.
Application and Network Interceptors should check for a push callback and apply transformations to the request and response accordingly.
Other changes or bugfixes
- Fixed writing HTTP/2 request bodies
- Fixed failed requests over HTTP/2 leaving promise returned from
Client::request()
unresolved - Using pseudo headers (headers field names starting with a colon (:)) in a
Request
orResponse
object is now forbidden
4.0.0 RC1
Note: This is a pre-release, there might be breaking changes in the final stable version.
This is the first release candidate of amphp/http-client
v4. Previously this package was named amphp/artax
. Development of the v3.x release series will continue in the old amphp/artax
repository.
Please test this pre-release carefully and report any issues you find, so we can soon tag a stable release with support for HTTP/2.
Major Changes
- Support for HTTP/2
- Support for
ApplicationInterceptor
/NetworkInterceptor
- Changed
Request
/Response
to be mutable - Compatibility with
amphp/socket
v1.0.0 Client
is now afinal class
instead of aninterface
Client
behavior should now be modified using interceptors and connection pool implementations
3.0.14
3.0.13
3.0.12
3.0.11
- Fixed issues with responses without
content-length
and withouttransfer-encoding: chunked
. - Revert fix for v3.0.10, as this has been properly fixed in
amphp/byte-stream
. - Catch
ConnectException
fromamphp/socket
and throwSocketException
instead. The exception was previously leaked, but undocumented and unexpected.
3.0.10
3.0.9
- Lazily parse captured TLS certificates. This improves performance and memory usage. Additionally,
openssl_x509_parse
currently leaks memory. This fix ensures it leaks only if explicitly requested (until the PHP bug is fixed). See https://bugs.php.net/bug.php?id=75363. - Small performance improvements for connections not using a proxy.