Skip to content

Releases: amphp/http-client

4.2.0

27 Feb 20:38
v4.2.0
Compare
Choose a tag to compare
  • 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

17 Jan 21:55
v4.1.0
Compare
Choose a tag to compare
  • 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 and user-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

06 Jan 15:34
9132948
Compare
Choose a tag to compare
4.1.0 RC1 Pre-release
Pre-release
  • Removed (internal) HTTP/2 parser in this library in favor of a shared parser in amphp/http.
  • Fixed problem where occasionally a promise was resolved twice in Http1Connection (#244)

4.0.0

21 Dec 10:55
v4.0.0
Compare
Choose a tag to compare

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

12 Dec 22:12
v4.0.0-rc11
Compare
Choose a tag to compare
4.0.0 RC11 Pre-release
Pre-release

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 of nghttp2 using FFI on PHP 7.4 if available

4.0.0 RC10

04 Dec 18:42
v4.0.0-rc10
Compare
Choose a tag to compare
4.0.0 RC10 Pre-release
Pre-release

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

20 Nov 18:54
v4.0.0-rc9
Compare
Choose a tag to compare
4.0.0 RC9 Pre-release
Pre-release

Note: This is a pre-release, there might be breaking changes in the final stable version.

  • Added EventListener with additional responsibilities for ConnectionPool, Stream and DelegateHttpClient implementations.
  • Added LimitedConnectionPool to limit concurrent requests per host
  • Added LogHttpArchive allowing to inspect request timings visually
  • Changed HttpClient to be a final class instead of an interface
  • 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 of EncryptableSocket instead of Socket now.
  • Http1Connection reuses connections without explicit keep-alive header for idempotent requests now.
  • Pushed requests validate the authority automatically now.
  • Renamed IfOrigin to MatchOrigin 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 into HttpClientBuilder
  • Removed pings on idle Http2Connection::request() improving the overall latency.
  • Removed ConditionalInterceptor
  • Renamed Request::getPushCallable() to Request::getPushHandler()
  • Renamed Request::onPush() to Request::setPushHandler()
  • Renamed DefaultConnectionPool to UnlimitedConnectionPool
  • 1XX responses are properly skipped now.
  • Removed Connection::MAX_KEEP_ALIVE_TIMEOUT constant.
  • Removed ConnectionPool::getProtocolVersions()

4.0.0 RC8

05 Nov 17:51
07abf23
Compare
Choose a tag to compare
4.0.0 RC8 Pre-release
Pre-release

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

01 Nov 16:07
v4.0.0-rc7
Compare
Choose a tag to compare
4.0.0 RC7 Pre-release
Pre-release

Note: This is a pre-release, there might be breaking changes in the final stable version.

  • Added HttpClient interface and HttpClientBuilder, use these instead of the previous Client class
  • Added gzip bomb protection (#208)
  • Added Request::removeAttributes()
  • Added ConditionalInterceptor / IfOrigin interceptor
  • Added Response::getOriginalResponse()
  • Added optional $body parameter to Request::__construct()
  • Allow null return in ModifyRequest / 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(), use Response::setStatus() with its second parameter instead

4.0.0 RC6

08 Oct 22:58
v4.0.0-rc6
Compare
Choose a tag to compare
4.0.0 RC6 Pre-release
Pre-release

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 and DefaultConnectionPool to be immutable, adding an interceptor returns a new instance now
  • Client follows redirects by default, with an option to disable
  • Client 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