| CARVIEW |
Select Language
HTTP/2 302
date: Sun, 28 Dec 2025 13:18:47 GMT
content-type: text/html; charset=utf-8
content-length: 0
location: https://docs.guzzlephp.org/en/stable/
server: cloudflare
cf-ray: 9b515876da2475e9-BLR
cf-cache-status: EXPIRED
cache-control: max-age=1200
content-language: en
vary: Accept-Language, Accept-Encoding
cdn-cache-control: public
cross-origin-opener-policy: same-origin
referrer-policy: no-referrer-when-downgrade
x-backend: web-i-0daa68303d03c8b06
x-content-type-options: nosniff
x-rtd-domain: docs.guzzlephp.org
x-rtd-force-addons: true
x-rtd-project: guzzle
x-rtd-project-method: custom_domain
x-rtd-redirect: system
x-rtd-resolver-filename: /
x-rtd-version: stable
x-rtd-version-method: path
x-served: Django-Proxito
set-cookie: __cf_bm=vwUAN0gCPn639xjb2WsT3e0aEQ47DGeiy12g.alT0AI-1766927927-1.0.1.1-IwxtPsiX.6jmHhHIVonfPoniKudgl0zjOfhkLqmvks5FMMuY.8mtsTjI8MK_yLzp8o1JRruAyKZsfRwGlICGbUhbTX8auZ7Txo5e12jw_Dg; path=/; expires=Sun, 28-Dec-25 13:48:47 GMT; domain=.docs.guzzlephp.org; HttpOnly; Secure; SameSite=None
set-cookie: _cfuvid=K.EEIuzIvzE4Y5QmYlntNbroGICF_iSYJe8nZhz9dkc-1766927927918-0.0.1.1-604800000; path=/; domain=.docs.guzzlephp.org; HttpOnly; Secure; SameSite=None
alt-svc: h3=":443"; ma=86400
HTTP/2 200
date: Sun, 28 Dec 2025 13:18:48 GMT
content-type: text/html
server: cloudflare
cf-ray: 9b51587d89e375e9-BLR
cf-cache-status: HIT
access-control-allow-origin: *
cache-control: max-age=1200
content-encoding: gzip
etag: W/"488d38016ef85bd92088fa4fc2e22aab"
last-modified: Mon, 18 Oct 2021 09:53:33 GMT
vary: Accept-Encoding
access-control-allow-methods: HEAD, OPTIONS, GET
cdn-cache-control: public
cross-origin-opener-policy: same-origin
referrer-policy: no-referrer-when-downgrade
x-amz-id-2: +x6HT9EGy2503vTeU80tX0OQZRZ7+DKY63fQojP/PI4yoAzFltUYQbjps57pLB0n21BSTHYncYm6XJod9hH0SdDfN7AvyMWHQdUjq2VrGbU=
x-amz-request-id: 26WR1MPX6FDBBJHC
x-backend: web-i-0742adf2a91dd2c58
x-content-type-options: nosniff
x-rtd-domain: docs.guzzlephp.org
x-rtd-force-addons: true
x-rtd-path: /proxito/html/guzzle/stable/index.html
x-rtd-project: guzzle
x-rtd-project-method: custom_domain
x-rtd-resolver-filename: /
x-rtd-version: stable
x-rtd-version-method: path
x-served: Nginx-Proxito-Sendfile
alt-svc: h3=":443"; ma=86400
Guzzle, PHP HTTP client — Guzzle Documentation
- Docs
- Guzzle, PHP HTTP client
Guzzle Documentation¶
Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and trivial to integrate with web services.
- Simple interface for building query strings, POST requests, streaming large uploads, streaming large downloads, using HTTP cookies, uploading JSON data, etc...
- Can send both synchronous and asynchronous requests using the same interface.
- Uses PSR-7 interfaces for requests, responses, and streams. This allows you to utilize other PSR-7 compatible libraries with Guzzle.
- Abstracts away the underlying HTTP transport, allowing you to write environment and transport agnostic code; i.e., no hard dependency on cURL, PHP streams, sockets, or non-blocking event loops.
- Middleware system allows you to augment and compose client behavior.
$client = new GuzzleHttp\Client();
$res = $client->request('GET', 'https://api.github.com/user', [
'auth' => ['user', 'pass']
]);
echo $res->getStatusCode();
// "200"
echo $res->getHeader('content-type')[0];
// 'application/json; charset=utf8'
echo $res->getBody();
// {"type":"User"...'
// Send an asynchronous request.
$request = new \GuzzleHttp\Psr7\Request('GET', 'https://httpbin.org');
$promise = $client->sendAsync($request)->then(function ($response) {
echo 'I completed! ' . $response->getBody();
});
$promise->wait();
User Guide¶
- Overview
- Quickstart
- Request Options
- Guzzle and PSR-7
- Handlers and Middleware
- Testing Guzzle Clients
- FAQ
- Does Guzzle require cURL?
- Can Guzzle send asynchronous requests?
- How can I add custom cURL options?
- How can I add custom stream context options?
- Why am I getting an SSL verification error?
- What is this Maximum function nesting error?
- Why am I getting a 417 error response?
- How can I track redirected requests?
© Copyright 2015, Michael Dowling. Created using Sphinx.