Releases: amphp/http-client
4.0.0 RC6
Note: This is a pre-release, there might be breaking changes in the final stable version.
- Connections are now attempted concurrently except for the first connection to a specific host if TLS is used, as that connection might be able to use HTTP/2
- Improved
Response::setBody()
API - Improved backpressure mechanism for HTTP/2
- Changed
Client
andDefaultConnectionPool
to be immutable, adding an interceptor returns a new instance now Client
follows redirects by default, with an option to disableClient
automatically retries unprocessed requests on properly closed HTTP/2 connections and idempotent requests on all connections up to two times now, the limit is customizable- Added support for request attributes, a request local mutable storage for custom application / interceptor data
- Removed unused
DnsException
4.0.0 RC5
Note: This is a pre-release, there might be breaking changes in the final stable version.
- Added compatibility for
amphp/file@^1
. - Fixed cancelling an HTTP/1.x request while the request was being written.
4.0.0 RC4
Note: This is a pre-release, there might be breaking changes in the final stable version.
- Fixed appending query to path in HTTP/2 requests.
4.0.0 RC3
Note: This is a pre-release, there might be breaking changes in the final stable version.
- Added
TimeoutInterceptor
that automatically sets request timeouts when used in a Client interceptor stack (#188). - HTTP/2 protocol is now declared as
"2"
instead of"2.0"
in requests and responses (see https://http2.github.io/faq/#is-it-http20-or-http2). - Pushed requests are no longer modified by interceptors extending
ModifyRequest
. - Fixed cancellation of requests over HTTP/2.
- Fixed timeouts of requests over HTTP/2.
- Fixed remaining HTTP/2 stream calculations.
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.