- Updated code to not raise warnings for nullable parameters in PHP 8.4.
- Cleaned up PHPDoc comments.
- Allow installation with Symfony 7.
- Dropped
php-http/message-factory
from composer requirements as it is abandoned and this package does not actually use it.
- Allow installation with http-message (PSR-7) version 2 in addition to version 1.
- Support for PHP 8.2
- [RedirectPlugin] Redirection of non GET/HEAD requests with a body now removes the body on follow-up requests, if the
HTTP method changes. To do this, the plugin needs to find a PSR-7 stream implementation. If none is found, you can
explicitly pass a PSR-17 StreamFactoryInterface in the
stream_factory
option. To keep sending the body in all cases, set thestream_factory
option to null explicitly.
- [RedirectPlugin] Fixed handling of redirection to different domain with default port
- [RedirectPlugin] Fixed false positive circular detection in RedirectPlugin in cases when target location does not contain path
- Support for Symfony 6
- Support for PHP 8.1
- Dropped support for Symfony 2 and 3 - please keep using version 2.4.0 of this library if you can't update Symfony.
strict
option toRedirectPlugin
to allow preserving the request method on redirections with status 300, 301 and 302.
- HttpMethodsClient with PSR RequestFactory
- Bug in the cookie plugin with empty cookies
- Bug when parsing null-valued date headers
- Deprecation when constructing a HttpMethodsClient with PSR RequestFactory but without a StreamFactory
- Support for PHP 8
- Plugin callable phpdoc
- Plugin client builder for making a
PluginClient
- Support for the PSR-17 request factory in
HttpMethodsClient
- Restored support for
symfony/options-resolver: ^2.6
- Consistent implementation of union type checking
- Memory leak when using the
PluginClient
with plugins
- Support Symfony 5
- HttpClientRouter now throws a HttpClientNoMatchException instead of a RequestException if it can not find a client for the request.
- RetryPlugin will only retry exceptions when there is no response, or a response in the 5xx HTTP code range.
- RetryPlugin also retries when no exception is thrown if the responses has HTTP code in the 5xx range. The callbacks for exception handling have been renamed and callbacks for response handling have been added.
- Abstract method
HttpClientPool::chooseHttpClient()
has now an explicit return type (Http\Client\Common\HttpClientPoolItem
) - Interface method
Plugin::handleRequest(...)
has now an explicit return type (Http\Promise\Promise
) - Made classes final that are not intended to be extended.
- Added interfaces for BatchClient, HttpClientRouter and HttpMethodsClient.
(These interfaces use the
Interface
suffix to avoid name collisions.) - Added an interface for HttpClientPool and moved the abstract class to the HttpClientPool sub namespace.
- AddPathPlugin: Do not add the prefix if the URL already has the same prefix.
- All exceptions in
Http\Client\Common\Exception
are final.
- Deprecated option
debug_plugins
has been removed fromPluginClient
- Deprecated options
decider
anddelay
have been removed fromRetryPlugin
, useexception_decider
andexception_delay
instead.
- Backported from version 2: AddPathPlugin: Do not add the prefix if the URL already has the same prefix.
- Support for Symfony 5
- Updated type hints in doc blocks.
- Support for PSR-18 clients
- Added traits
VersionBridgePlugin
andVersionBridgeClient
to help plugins and clients to support both 1.x and 2.x version ofphp-http/client-common
andphp-http/httplug
.
- RetryPlugin: Renamed the configuration options for the exception retry callback from
decider
toexception_decider
anddelay
toexception_delay
. The old names still work but are deprecated.
- When multiple cookies exist, a single header with all cookies is sent as per RFC 6265 Section 5.4
- AddPathPlugin will now trim of ending slashes in paths
- Reverted change to RetryPlugin so it again waits when retrying to avoid "can only throw objects" error.
- Add an option on ErrorPlugin to only throw exception on response with 5XX status code.
- AddPathPlugin no longer add prefix multiple times if a request is restarted - it now only adds the prefix if that request chain has not yet passed through the AddPathPlugin
- RetryPlugin no longer wait for retried requests and use a deferred promise instead
- Decoder plugin will now remove header when there is no more encoding, instead of setting to an empty array
- Symfony 4 support
- Strict comparison in DecoderPlugin
- Add HttpClientPool client to leverage load balancing and fallback mechanism see the documentation for more details.
PluginClientFactory
to createPluginClient
instances.- Added new option 'delay' for
RetryPlugin
. - Added new option 'decider' for
RetryPlugin
. - Supports more cookie date formats in the Cookie Plugin
- The
RetryPlugin
does now wait between retries. To disable/change this feature you must write something like:
$plugin = new RetryPlugin(['delay' => function(RequestInterface $request, Exception $e, $retries) {
return 0;
});
- The
debug_plugins
option forPluginClient
is deprecated and will be removed in 2.0. Use the decorator design pattern instead like in ProfilePlugin.
QueryDefaultsPlugin
to add default query parameters.
DecoderPlugin
does not longer claim to supportcompress
content encoding
CookiePlugin
allows main domain cookies to be sent/stored for subdomainsDecoderPlugin
uses the rightFilteredStream
to handledeflate
content encoding
- Cast return value of
StreamInterface::getSize
to string inContentLengthPlugin
- Add Path plugin
- Base URI plugin that combines Add Host and Add Path plugins
- Fix Emulated Trait to use Http based promise which respect the HttpAsyncClient interface
- Require Httplug 1.1 where we use HTTP specific promises.
- RedirectPlugin: use the full URL instead of the URI to properly keep track of redirects
- Add AddPathPlugin for API URLs with base path
- Add BaseUriPlugin that combines AddHostPlugin and AddPathPlugin
- AddHostPlugin also sets the port if specified
- Suggest separate plugins in composer.json
- Introduced
debug_plugins
option forPluginClient
- Add a flexible http client providing both contract, and only emulating what's necessary
- HTTP Client Router: route requests to underlying clients
- Plugin client and core plugins moved here from
php-http/plugins
- Extending client classes, they will be made final in version 2.0
- Remove useless interface in BatchException
- Updated package files
- Updated HTTPlug to RC1
- Emulated clients
- Batch client from utils
- Methods client from utils
- Emulators and decorators from client-tools