NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist, #17 most downloaded on Packagist
Guzzle is a PHP HTTP client library
Latest stable
8.5.5
Last release today
21 Nov 2026
Ships fairly regularly
a new release about every 2 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
15 years old
203 releases · first in 2011
Drag across the ruler to compare, or tap a release to open it.
See change log for changes.
See change log for changes.
SetCookie::fromString MaxAge deprecation warning and skip invalid MaxAge valuesSee change log for changes.
See change log for changes.
Your coding agent can read these notes before it upgrades. Set up the MCP server →
See change log for changes.
See change log for changes.
See change log for changes.
See change log for changes.
'0' bodySee change log for changes.
See change log for changes.
NO_PROXY settings so that setting the proxy option to no overrides the env variableguzzlehttp/psr7 version constraint to ^1.9.1 || ^2.4.5See change log for changes.
See change log for changes.
See change log for changes.
See change log for changes.
CURLOPT_HTTPAUTH option not cleared on change of originSee change log for changes.
See change log for changes.
See change log for changes.
See change log for changes.
See change log for changes.
See change log for changes.
force_ip_resolveSee change log for changes.
See change log for changes.
See change log for changes.
See change log for changes.
restore_error_handler() #2915InvalidArgumentException when an incorrect headers array is provided #2916, #2942See change log for changes.
See change log for changes.
guzzlehttp/psr7:^2.0 #2878See change log for changes.
See change log for changes.
See change log for changes.
See change log for changes.
sink on HEAD requests.See change log for changes.
See change log for changes.
GuzzleHttp\MessageFormatterInterfaceGuzzleHttp has been deprecated. Use static methods on Utils instead.ClientInterface::getConfig()Client::getConfig()Client::__call()Utils::defaultCaBundle()CurlFactory::LOW_CURL_VERSION_NUMBERSee change log for changes.
See change log for changes.
No changes since 7.0.0-RC1. See UPGRADING guide for how to upgrade from 6.5.
No changes since 7.0.0-RC1. See UPGRADING guide for how to upgrade from 6.5.
See all changes in the change log.
See change log for changes.
See change log for changes.
See change log for changes.
See change log for changes.
First beta release of the 7.x release branch.
First beta release of the 7.x release branch.
Major changes:
Enjoy!
Many thanks to everyone who worked on this release, especially:
See change log for changes.
See change log for changes.
See change log for changes.
See change log for changes.
See change log for changes.
See change log for changes.
Nothing published for this version
Nothing published for this version
Nothing published for this version
idn_to_ascii() fix for old PHP versions #2489
Better defaults for PHP installations with old ICU lib #2454
Deprecated ClientInterface::VERSION
curl_multi_init. #2287null to the header option. #2132RetryMiddleware did not do exponential delay between retires due unit mismatch. #2132ClientInterface::VERSIONNo guzzle.phar was created in 6.4.0 due expired API token. This release will fix that
guzzle.phar was created in 6.4.0 due expired API token. This release will fix thatparent::__construct() to FileCookieJar and SessionCookieJarImprovement: Improved error messages when using curl < 7.21.2 #2108
RequestException::getResponseBodySummary() #2081GuzzleHttp\Exception\InvalidArgumentException #2163GuzzleHttp\_current_time() to use hrtime() if that function exists. #2242appconnect_time in TransferStats #2284CookieJar #2335MockHandler so we can test transfer time #2362Fix: Default headers when decode_content is specified
Bug fix: Parsing 0 epoch expiry times in cookies #2014
Bug fix: Parsing 0 epoch expiry times in cookies #2014
Deprecation: BadResponseException instantiation without a response #1642
on_headers option in MockHandler #1580read_timeout option #1611CURLOPT_CAPATH and CURLOPT_CAINFO properly #1684\GuzzleHttp\Promise\rejection_for function instead of object init #1827Fix deprecations with guzzle/psr7 version 1.4
Allow to pass nullable Response to delay callable
Addressing HTTP_PROXY security vulnerability, CVE-2016-5385: https://httpoxy.org/. Please update to this version of Guzzle in order to mitigate the vu…
Content-Length in PHP StreamHandler to avoid timeouts when a server does not honor Connection: close.Feature: added GuzzleHttp\json_encode and GuzzleHttp\json_decode. https://github.com/guzzle/guzzle/pull/1389
GuzzleHttp\json_encode and GuzzleHttp\json_decode.
https://github.com/guzzle/guzzle/pull/1389http_build_query for HHVM workaround.
https://github.com/guzzle/guzzle/pull/1367Bug fix: Proxy::wrapSync() now correctly proxies to the appropriate handler https://github.com/guzzle/guzzle/commit/911bcbc8b434adce64e223a6d1d14e9a8f
sink.
https://github.com/guzzle/guzzle/pull/1292Feature: Added the on_stats request option to provide access to transfer statistics for requests. https://github.com/guzzle/guzzle/pull/1202
on_stats request option to provide access to transfer
statistics for requests. https://github.com/guzzle/guzzle/pull/1202= inside of quotes in Cookies.
https://github.com/guzzle/guzzle/pull/1232body_as_string setting
https://github.com/guzzle/guzzle/pull/1201form_params and query now always uses the & separator.
https://github.com/guzzle/guzzle/pull/1163Fixed a memory leak in the curl handlers in which references to callbacks were not being removed by curl_reset.
curl_reset.Content-Encoding header may be removed an the
Content-Length modified to reflect the message size after removing the
encoding.form_params and
multipart in the same request.Fixed a bug with serializing the query request option where the & separator was missing.
query request option where the &
separator was missing.body is provided as an array. Please
use form_params or multipart instead.Guzzle now uses PSR-7 for HTTP messages. Due to the fact that these messages are immutable, this prompted a refactoring of Guzzle to use a middleware
Guzzle now uses PSR-7 for HTTP messages.
Due to the fact that these messages are immutable, this prompted a refactoring
of Guzzle to use a middleware based system rather than an event system. Any
HTTP message interaction (e.g., GuzzleHttp\Message\Request) need to be
updated to work with the new immutable PSR-7 request and response objects. Any
event listeners or subscribers need to be updated to become middleware
functions that wrap handlers (or are injected into a
GuzzleHttp\HandlerStack).
GuzzleHttp\BatchResultsGuzzleHttp\CollectionGuzzleHttp\HasDataTraitGuzzleHttp\ToArrayInterfaceguzzlehttp/streams dependency has been removed. Stream functionality
is now present in the GuzzleHttp\Psr7 namespace provided by the
guzzlehttp/psr7 package.guzzlehttp/promises library. We use a custom promise library for three
significant reasons:
GuzzleHttp\Mimetypes has been moved to a function in
GuzzleHttp\Psr7\mimetype_from_extension and
GuzzleHttp\Psr7\mimetype_from_filename.GuzzleHttp\Query and GuzzleHttp\QueryParser have been removed. Query
strings must now be passed into request objects as strings, or provided to
the query request option when creating requests with clients. The query
option uses PHP's http_build_query to convert an array to a string. If you
need a different serialization technique, you will need to pass the query
string in as a string. There are a couple helper functions that will make
working with query strings easier: GuzzleHttp\Psr7\parse_query and
GuzzleHttp\Psr7\build_query.GuzzleHttp\Handler namespace. This significantly reduces
complexity in Guzzle, removes a dependency, and improves performance. RingPHP
will be maintained for Guzzle 5 support, but will no longer be a part of
Guzzle 6.Event namespace.Subscriber namespace.Transaction classRequestFsmRingBridgeGuzzleHttp\Subscriber\Cookie is now provided by
GuzzleHttp\Middleware::cookiesGuzzleHttp\Subscriber\HttpError is now provided by
GuzzleHttp\Middleware::httpErrorGuzzleHttp\Subscriber\History is now provided by
GuzzleHttp\Middleware::historyGuzzleHttp\Subscriber\Mock is now provided by
GuzzleHttp\Middleware::mockGuzzleHttp\Subscriber\Prepare is now provided by
GuzzleHttp\PrepareBodyMiddlewareGuzzleHttp\Subscriber\Redirect is now provided by
GuzzleHttp\RedirectMiddlewarePsr\Http\Message\UriInterface (implements in
GuzzleHttp\Psr7\Uri) for URI support. GuzzleHttp\Url is now gone.GuzzleHttp\Utils have been moved to namespaced
functions under the GuzzleHttp namespace. This requires either a Composer
based autoloader or you to include functions.php.GuzzleHttp\ClientInterface::getDefaultOption has been renamed to
GuzzleHttp\ClientInterface::getConfig.GuzzleHttp\ClientInterface::setDefaultOption has been removed.The change to PSR-7 unfortunately required significant refactoring to Guzzle due to the fact that PSR-7 messages are immutable. Guzzle 5 relied on an event system from plugins. The event system relied on mutability of HTTP messages and side effects in order to work. With immutable messages, you have to change your workflow to become more about either returning a value (e.g., functional middlewares) or setting a value on an object. Guzzle v6 has chosen the functional middleware approach.
Instead of using the event system to listen for things like the before event,
you now create a stack based middleware function that intercepts a request on
the way in and the promise of the response on the way out. This is a much
simpler and more predictable approach than the event system and works nicely
with PSR-7 middleware. Due to the use of promises, the middleware system is
also asynchronous.
v5:
use GuzzleHttp\Event\BeforeEvent;
$client = new GuzzleHttp\Client();
// Get the emitter and listen to the before event.
$client->getEmitter()->on('before', function (BeforeEvent $e) {
// Guzzle v5 events relied on mutation
$e->getRequest()->setHeader('X-Foo', 'Bar');
});
v6:
In v6, you can modify the request before it is sent using the mapRequest
middleware. The idiomatic way in v6 to modify the request/response lifecycle is
to setup a handler middleware stack up front and inject the handler into a
client.
use GuzzleHttp\Middleware;
// Create a handler stack that has all of the default middlewares attached
$handler = GuzzleHttp\HandlerStack::create();
// Push the handler onto the handler stack
$handler->push(Middleware::mapRequest(function (RequestInterface $request) {
// Notice that we have to return a request object
return $request->withHeader('X-Foo', 'Bar');
});
// Inject the handler into the client
$client = new GuzzleHttp\Client(['handler' => $handler]);
multipart and form_params request options.synchronous request option.on_headers request option.expect handling.default to true. This is no longer
required now that the cURL loop is not ticked for async requests.sink is valid if saving to a file.GuzzleHttp\RequestOptions to allow request options to be applied
using constants.$maxHandles has been removed from CurlMultiHandler.MultipartPostBody is now part of the guzzlehttp/psr7 package.Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Marked GuzzleHttp\Client::getDefaultUserAgent as deprecated.
save_toAbstractRequestEvent::getTransaction() as public.Utils::getDefaultHandler()GuzzleHttp\Client::getDefaultUserAgent as deprecated.Added AppliesHeadersInterface to make applying headers to a request based on the body more generic and not specific to PostBodyInterface.
AppliesHeadersInterface to make applying headers to a request based
on the body more generic and not specific to PostBodyInterface.Pool class no longer uses recursion when a request is intercepted.
null when creating a request with a client will
ensure that the option is not set. This allows you to overwrite default
request options on a per-request basis.
See #937.protocols array in the allow_redirects request option."0" is now an allowed URI path. See
#935.Query no longer typehints on the $query argument in the constructor,
allowing for strings and arrays.end event are now correctly wrapped with Guzzle
specific exceptions if necessary.This change updates query strings so that they are treated as un-encoded values by default where the value represents an un-encoded value to send over
This change updates query strings so that they are treated as un-encoded values by default where the value represents an un-encoded value to send over the wire. A Query object then encodes the value before sending over the wire. This means that even value query string values (e.g., ":") are url encoded. This makes the Query class match PHP's http_build_query function. However, if you want to send requests over the wire using valid query string characters that do not need to be encoded, then you can provide a string to Url::setQuery() and pass true as the second argument to specify that the query string is a raw string that should not be parsed or encoded (unless a call to getQuery() is subsequently made, forcing the query-string to be converted into a Query object).
Added a trailing \r\n to multipart/form-data payloads. See
\r\n to multipart/form-data payloads. See
#871GuzzleHttp\Pool::send() convenience method to match the docs.application/x-www-form-urlencoded header
when sending POST requests, allowing for customized headers. See
#877Added a trailing \r\n to multipart/form-data payloads. See
https://github.com/guzzle/guzzle/pull/871
Added a GuzzleHttp\Pool::send() convenience method to match the docs.
Status codes are now returned as integers. See https://github.com/guzzle/guzzle/issues/881
No longer overwriting an existing application/x-www-form-urlencoded header
when sending POST requests, allowing for customized headers. See
https://github.com/guzzle/guzzle/issues/877
Improved path URL serialization.
rawString argument is provided when setting the query
string on a URL: Now allowing many more characters to be present in the
query string without being percent encoded. See
https://datatracker.ietf.org/doc/html/rfc3986#appendix-AFixed an issue where connection errors still returned response object in error and end events event though the response is unusable. This has been cor
Bugfix release.
getResponse method of
these events if the response did not complete. https://github.com/guzzle/guzzle/issues/867The breaking changes in this release are relatively minor. The biggest thing to look out for is that request and response objects no longer implement…
Adding support for non-blocking responses and some minor API cleanup.
guzzlehttp/guzzle-ring.GuzzleHttp\Pool which implements FutureInterface and transfers
requests concurrently using a capped pool size as efficiently as possible.hasListeners() to EmitterInterface.GuzzleHttp\ClientInterface::sendAll and marked
GuzzleHttp\Client::sendAll as deprecated (it's still there, just not the
recommended way).The breaking changes in this release are relatively minor. The biggest thing to look out for is that request and response objects no longer implement fluent interfaces.
return $this) from requests,
responses, GuzzleHttp\Collection, GuzzleHttp\Url,
GuzzleHttp\Query, GuzzleHttp\Post\PostBody, and
GuzzleHttp\Cookie\SetCookie. This blog post provides a good outline of
why I did this: http://ocramius.github.io/blog/fluent-interfaces-are-evil/.
This also makes the Guzzle message interfaces compatible with the current
PSR-7 message proposal.GuzzleHttp\Utils using camelCase. GuzzleHttp\json_decode
moved to GuzzleHttp\Utils::jsonDecode. GuzzleHttp\get_path moved to
GuzzleHttp\Utils::getPath. GuzzleHttp\set_path moved to
GuzzleHttp\Utils::setPath. GuzzleHttp\batch should now be
GuzzleHttp\Pool::batch, which returns an SplObjectStorage. Using functions.php
caused problems for many users: they aren't PSR-4 compliant, require an
explicit include, and needed an if-guard to ensure that the functions are not
declared multiple times.GuzzleHttp\Adapter, these are now
implemented as callables that are stored in GuzzleHttp\Ring\Client.GuzzleHttp\Adapter\Transaction to GuzzleHttp\Transaction. The
Transaction object now exposes the request, response, and client as public
properties. The getters and setters have been removed.asArray parameter from
GuzzleHttp\Message\MessageInterface::getHeader. If you want to get a header
value as an array, then use the newly added getHeaderAsArray() method of
MessageInterface. This change makes the Guzzle interfaces compatible with
the PSR-7 interfaces.GuzzleHttp\Message\MessageFactory no longer allows subclasses to add
custom request options using double-dispatch (this was an implementation
detail). Instead, you should now provide an associative array to the
constructor which is a mapping of the request option name mapping to a
function that applies the option value to a request.GuzzleHttp\Stream\StreamInterface::getContents() no longer accepts a
maxLen parameter. This update makes the Guzzle streams project
compatible with the current PSR-7 proposal.GuzzleHttp\Stream\Stream::__construct,
GuzzleHttp\Stream\Stream::factory, and
GuzzleHttp\Stream\Utils::create no longer accept a size in the second
argument. They now accept an associative array of options, including the
"size" key and "metadata" key which can be used to provide custom metadata.Nothing published for this version
Nothing published for this version
Fixed a memory leak in the CurlAdapter when reusing cURL handles.
request_fulluri in stream adapter proxies.Ensuring that the StreamAdapter does not always add a Content-Type header
One column per quarter.