Releases: amphp/http-client
4.2.0
-
Add improved ConnectionLimitingPool
The new ConnectionLimitingPool limits connections instead of streams. In addition, it has improved connection handling, racing between new connections and existing connections becoming available once the limit has been reached. The older LimitedConnectionPool has been renamed to StreamLimitingPool with a class alias for backward compatibility.
-
Don't set ALPN if only HTTP/1.1 is enabled, which allows connections to certain misbehaving servers (#255)
4.1.0
- Fix possible double resolution of promises (#244)
- Fix assertion error on invalid HTTP/2 frame (#236)
- Fix HTTP/2 connection reuse if too many concurrent streams for one connection are in use (#246)
- Allow skipping default
accept
,accept-encoding
anduser-agent
headers (#238) - Keep original header case for HTTP/1 requests (#250)
- Allow access to informational responses (1XX) (#239)
- Await
startReceiveResponse
event listeners on HTTP/2 before resolving the response promise (#254) - Delay
startReceiveResponse
event until the final response is started to be received, instead of calling it for the first byte or multiple times for HTTP/2 (#254) - Use common HTTP/2 parser from
amphp/http
4.1.0 RC1
4.0.0
Initial release of amphp/http-client
, the successor of amphp/artax
.
This is a major rewrite to support interceptors and HTTP/2.
Major Changes
- Support for HTTP/2 (including push)
- Support for interceptors to customize behavior
- Switch to a mutable
Request
/Response
API, because streams are not immutable - Compatibility with
amphp/socket@^1
- Compatibility with
amphp/file@^1
- Compatibility with
league/uri@^6
4.0.0 RC11
Note: This is a pre-release, there might be breaking changes in the final stable version.
- Forbid
CONNECT
requests on HTTP/2 - Upgrade to
amphp/hpack@^3
to make use ofnghttp2
using FFI on PHP 7.4 if available
4.0.0 RC10
Note: This is a pre-release, there might be breaking changes in the final stable version.
- Refactored HTTP/2 to split parsing from frame handling logic.
- Fixed upgrade handling to close the socket only on error.
- Fixed default HTTP/2 push port.
- Fixed HTTP/2 backpressure.
- Fixed HTTP/2 stream weight.
- Decoupled
UnlimitedConnectionPool
from hardcoded HTTP versions. - Responses are now only returned after sending the request finished.
- Removed
Http2Exception
.
4.0.0 RC9
Note: This is a pre-release, there might be breaking changes in the final stable version.
- Added
EventListener
with additional responsibilities forConnectionPool
,Stream
andDelegateHttpClient
implementations. - Added
LimitedConnectionPool
to limit concurrent requests per host - Added
LogHttpArchive
allowing to inspect request timings visually - Changed
HttpClient
to be afinal class
instead of aninterface
- Changed redirect policy to only follow automatically with
GET
requests - Application interceptors doing retries or follow-up requests must now manually clone the request if they wish to reuse it. Previously any
HttpClient
implementation was required to automatically clone at every layer. Http1Connection::__construct()
requires an instance ofEncryptableSocket
instead ofSocket
now.Http1Connection
reuses connections without explicitkeep-alive
header for idempotent requests now.- Pushed requests validate the authority automatically now.
- Renamed
IfOrigin
toMatchOrigin
and changed the implementation to map multiple origins. - Requests can now set an upgrade handler to opt-into connection upgrades, e.g. for WebSocket connections or CONNECT tunnels.
- Removed default interceptors from
PooledHttpClient
and moved them intoHttpClientBuilder
- Removed pings on idle
Http2Connection::request()
improving the overall latency. - Removed
ConditionalInterceptor
- Renamed
Request::getPushCallable()
toRequest::getPushHandler()
- Renamed
Request::onPush()
toRequest::setPushHandler()
- Renamed
DefaultConnectionPool
toUnlimitedConnectionPool
1XX
responses are properly skipped now.- Removed
Connection::MAX_KEEP_ALIVE_TIMEOUT
constant. - Removed
ConnectionPool::getProtocolVersions()
4.0.0 RC8
Note: This is a pre-release, there might be breaking changes in the final stable version.
- Updated to
league/uri@^6
. Consequentially, PHP 7.2+ is now required.
4.0.0 RC7
Note: This is a pre-release, there might be breaking changes in the final stable version.
- Added
HttpClient
interface andHttpClientBuilder
, use these instead of the previousClient
class - Added gzip bomb protection (#208)
- Added
Request::removeAttributes()
- Added
ConditionalInterceptor
/IfOrigin
interceptor - Added
Response::getOriginalResponse()
- Added optional
$body
parameter toRequest::__construct()
- Allow
null
return inModifyRequest
/ModifyResponse
- Drop
content-encoding
header on decompression (#207) - Use pings to test HTTP/2 connection liveness
- Improved request cloning
- Disallow user info in URIs by default
- Validate response protocol version
- Assign default reason phrase if none is provided
- Removed
Response::setReason()
, useResponse::setStatus()
with its second parameter instead
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