guzzlehttp/guzzle
Guzzle is a PHP HTTP client for sending sync or async requests with an easy API. Built on PSR-7 and PSR-18, supports middleware, cookies, streaming uploads/downloads, and JSON. Transport-agnostic for flexible integrations.
SensitiveParameter metadata to credential-bearing parameters so PHP 8.2+ redacts their values in exception tracesMultiplexing::NONE support as a client, cURL multi handler, and conditional request optionConnectTimeoutException for connect-phase timeouts, extending ConnectExceptionNetworkException for no-response network failuresNetworkTimeoutException for no-response transport timeoutsResponseTransferException, with ResponseTimeoutException for response-transfer timeoutsrequest_factory, response_factory, stream_factory, and uri_factory request optionsclose() lifecycle methods to the built-in cURL handlers and concrete cURL factoryHandlerClosedException for pending transfers rejected by CurlMultiHandler::close()TransportSharing::PERSISTENT_PREFER and TransportSharing::PERSISTENT_REQUIRE)ProxyOptions for proxy option resolutionResponseException for request failures with responses__Secure- and __Host- prefix requirements on response cookiesFileCookieJar and SessionCookieJar persistence against unsafe unserializationFileCookieJar cookie files to owner-only permissionsRuntimeExceptionUtils time, timeout, IDN, and environment helpers to dedicated internal classesguzzlehttp/promises version constraint to ^3.0guzzlehttp/psr7 version constraint to ^3.0Content-Type boundary parameters when requiredSetCookie methodsstring return type to SetCookie::__toString()force_ip_resolve, protocols, and delay ranges at the client boundaryno entry as final even without a scheme-specific proxy entryRequestException, not InvalidArgumentException, for an unavailable proxy or TLS featureno_proxy/NO_PROXY from the environment in the stream handler, including * to disable proxyinghttps:// or SOCKS proxy in the stream handler, matching its proxy option behaviorProxy-Authorization on every routeProxy-Authorization field, including empty, on stream proxiesCURLOPT_PROXYHEADER without proxy header separation supporton_headers callbacksPool iterable key as a trailing argument to per-request observer callbacksidn_conversion, retries, and built-in handler on_stats option values before usequery and form_params optionsbody optionExpect: 100-Continue injection to HTTP/1.1 requests onlySetCookie constructor field types instead of coercing themnull as an omitted path or name when clearing cookiesauth request option arraysauth request optionauth request option when following cross-origin redirectsReferer header to the origin on cross-origin redirectsHandlerStack::remove() argumentsPool request collections to be iterableDomain attribute as host-only cookiesMax-Age over Expires when both attributes are presentCookieJar::getCookieByName()Max-Age cookie values instead of truncating themContent-Length and combinations with Transfer-EncodingTransfer-Encoding metadata and coalesced framing in progress on newer PHPLocation values in BadResponseExceptioncrypto_method option through the SSL context so it consistently controls the minimum TLS versionTransferException and its subclassesNetworkExceptionConnectException, with connect timeouts as ConnectTimeoutExceptionNetworkException, with timeouts as NetworkTimeoutExceptionResponseExceptionResponseTransferExceptionsink option or reads trailing bytes for responses that cannot carry a bodyContent-Length, including decoded gzip/deflateContent-Length casings and preserve encoded values on decoded responsesResponseException101 Switching Protocols before the final responseResponseException and skip non-seekable sink rewindsResponseExceptionGuzzleHttp\Exception\InvalidArgumentException for invalid built-in handler optionssink, and HTTP/3 setup failures as RequestExceptionConnectTimeoutException for connect timeoutsNetworkTimeoutException for cURL no-response timeout errorsResponseTimeoutException for response-aware transfer timeoutstimeout option as a total transfer deadline in the stream handler when it buffers the responsetimeout deadlinedefault_socket_timeout ini setting in the stream handlerread_timeout as an idle timeout for every request stage, defaulting to 60 secondsconnect_timeout set to 0 disabling itUser-Agent and From header values from the user_agent and from ini settingsRequestException or ResponseException by phaseResponseException or RequestException by phasesink as caller-owned in the built-in cURL and stream handlersLocation headersprogress callbacks to abort transfers with truthy return valuesprogress callback arguments to integer byte countsprogress throwables with ResponseException when a response exists, otherwise RequestExceptionon_statsCURLOPT_XFERINFOFUNCTION for built-in cURL progress callbacks when availableMessageFormatter final and required Middleware::log() formatters to implement MessageFormatterInterfaceCurlFactory, CurlHandler, CurlMultiHandler, MockHandler, and StreamHandler finalGuzzleHttp\Handler\Proxy finalon_trailers callbacks, reject non-callable on_trailers values, and wrap on_trailers callback exceptions in ResponseExceptionmultiplex defaults to Multiplexing::WAIT)CURLOPT_PIPEWAIT cURL option at the multiplex request optionCURLMOPT_PIPELINING in favour of the multiplex cURL multi handler optionCURLOPT_HTTPAUTH mask permits NTLMselect_timeout cURL multi handler option valuesSet-Cookie strings with RFC 6265 whitespace trimmingSet-Cookie attributes that require a value when parsingClient::__call(); use the typed HTTP verb methods or request()/requestAsync()ClientInterface::getConfig(); the concrete Client::getConfig() remains availableGUZZLE_CURL_SELECT_TIMEOUT environment variable; use CurlMultiHandler's select_timeout optionhandler request option; configure the handler on the clientCurlMultiHandler::$_mh; pass CURLMOPT_* values through constructor options insteadRedirectMiddleware::$defaultSettings; use RedirectMiddleware::DEFAULT_SETTINGSRetryMiddleware::exponentialDelay() methodRequestException::wrapException() methodUtils::describeType() methodUtils::jsonDecode() and Utils::jsonEncode() in favor of native JSON functionsGuzzleHttp namespace functions in favor of native or class equivalentsUtils::defaultCaBundle(); rely on the system trust store or pass a bundle path via the verify optionHandlerStack::__toString()RequestException::getHandlerContext() and ConnectException::getHandlerContext()RequestException; use ResponseExceptionUtils::isHostInNoProxy(); use ProxyOptions helpers for Guzzle 8 no-proxy matchingUtils::isUriInNoProxy(); use ProxyOptions::isUriInNoProxy()Handler\Proxy::wrapTlsFallback(); the default handler stack selects the cURL or stream handler by TLS support automaticallyCookie headers (GHSA-f283-ghqc-fg79)Referer headers generated for redirects (GHSA-h95v-h523-3mw8)Multiplexing::NONE support as a client, cURL multi handler, and conditional request optionguzzlehttp/psr7 version constraint to ^2.13Content-LengthCURLOPT_SHARE cURL option when named connection caps are configuredCURLOPT_PRE_PROXY and opaque share handlesUtils::jsonDecode() and Utils::jsonEncode() in favor of native JSON functionsCURLMOPT_PIPELINING in the cURL multi handler options arrayCURLOPT_PROXYHEADER without cURL proxy header separation supportContent-Length and Transfer-Encoding when redirects discard the request bodydelay request option to followed redirectsguzzlehttp/psr7 version constraint to ^2.12.5@ separatorsstream => true) on cap-configured stream handlersoptions valuesCURLOPT_HTTPAUTH mask permits NTLMCURLMOPT_PIPELINING when combined with explicit multiplexingon_stats callback throwson_trailers callback is configuredon_trailers callback before starting a cURL transferon_trailers request option on the stream handler, which cannot observe trailerson_trailers request option to expose parsed HTTP response trailersmultiplex request option with Multiplexing::* modes to control or require HTTP/2 multiplexingmultiplex requests when CURLMOPT_PIPELINING disables multiplexingmax_host_connections and max_total_connections client and cURL multi handler optionsCURLOPT_SHARE when combined with authenticated SOCKS proxy configurationCURLOPT_CERTINFO optionCURLOPT_PIPEWAIT cURL option in favour of the multiplex request optionselect_timeout cURL multi handler option valuesguzzlehttp/promises version constraint to ^2.5.1guzzlehttp/psr7 version constraint to ^2.12.4no_proxy valuesRuntimeExceptioncrypto_method_max request option to cap the maximum TLS protocol versionCURLOPT_SHARE when combined with authenticated HTTP/HTTPS proxy tunnel configurationCURLOPT_PREREQFUNCTION callbacks when defined by PHP cURLcrypto_method requests to the stream handler when cURL cannot select TLS 1.2guzzlehttp/psr7 version constraint to ^2.12.3Max-Age so a very large value no longer overflows to an already-expired timestampCookieJar conflict resolution so distinct numeric-string names don't overwriteDomain has a trailing dot on the origin host instead of silently discarding itStreamHandler hard-failing on bracketed IPv6 literal hosts when force_ip_resolve is setPath comparison so CookieJar::clear() with a numeric path keeps a distinct-path cookieDomain, Max-Age, path, and name valuesdecode_content handling for falsey string valuesguzzlehttp/psr7 version constraint to ^2.12.1Domain attributes as match-all (GHSA-cwxw-98qj-8qjx)RequestOptions constants for curl, retries, and stream_contextguzzlehttp/psr7 version constraint to ^2.12proxy request option makes a decisionPsr7\Utils::redactUserInfo()handler option, which will be ignored in 8.0CURLOPT_PROXYTYPE cURL request option; set the proxy type via a scheme-prefixed proxy URLntlm as a built-in auth typeUtils::describeType()query and form_params options; 8.0 rejects thembody option; 8.0 rejects themno list matches being re-proxied through environment-configured proxies by libcurlno list and NO_PROXY matching to support IP CIDR ranges, matching libcurltransport_sharing, matching other unknown request optionsproxy request option's no value as a comma-delimited stringprotocols request option to restrict allowed URI schemes for request transferscert_type and ssl_key_type request options for TLS certificate and private-key file typesssl_key request optiontransport_sharing client and cURL handler optionsguzzlehttp/promises version constraint to ^2.5guzzlehttp/psr7 version constraint to ^2.11SetCookie instances to be stored without wildcard request matchingCurlMultiHandler destructors from throwing during cleanupPool request collections, which will be rejected in 8.0headers request option values, which will be rejected in 8.0headers request option value arrays, which will be rejected in 8.0CURLOPT_SHARE, which will be rejected in 8.0idn_conversion request option values, which will be rejected in 8.0RequestException::wrapException(), which will be removed in 8.0RetryMiddleware::exponentialDelay(), which will be removed in 8.0CurlMultiHandler now rejects the promise when CurlFactory::finish() throws, preserving sibling transfersSetCookie now normalizes unparseable Expires values to null instead of falsegzip/deflate truncation by dropping invalid Content-LengthConnectExceptionoptions() to uppercase inferred HTTP methodsguzzlehttp/promises version constraint to ^2.3guzzlehttp/psr7 version constraint to ^2.8CurlMultiHandler to avoid busy wait if possibleguzzlehttp/psr7 v1call_user_func* with native callsSee 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.
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.
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.
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.
How can I help you explore Laravel packages today?