guzzlehttp / guzzle
Guzzle is a PHP HTTP client library
Requires
- php: ^7.4 || ^8.0
- ext-json: *
- guzzlehttp/promises: ^3.0
- guzzlehttp/psr7: ^3.0
- psr/http-client: ^1.0
- psr/http-factory: ^1.0
- symfony/polyfill-php80: ^1.25
- symfony/polyfill-php82: ^1.27
Requires (Dev)
- ext-curl: *
- bamarni/composer-bin-plugin: ^1.8.2
- guzzle/client-integration-tests: 4.0.1
- guzzlehttp/test-server: ^1.0@dev
- php-http/message-factory: ^1.1
- phpunit/phpunit: ^9.6.34
- psr/log: ^1.1 || ^2.0 || ^3.0
Suggests
Provides
This package is auto-updated.
Last update: 2026-07-20 14:00:35 UTC
README
Guzzle, PHP HTTP Client
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.
- Supports PSR-18, allowing interoperability with other PSR-18 HTTP clients.
- 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.
Installation
The recommended way to install Guzzle is through Composer.
composer require guzzlehttp/guzzle
Version Guidance
| Version | Status | PHP Version |
|---|---|---|
| 8.0 | Latest | >=7.4,<8.6 |
| 7.15 | Maintenance | >=7.2.5,<8.6 |
| 6.5 | End of Life | >=5.5,<8.0 |
Quick Start
$client = new \GuzzleHttp\Client(); $response = $client->request('GET', 'https://api.example.com/users/123'); echo $response->getStatusCode(); // 200 echo $response->getHeaderLine('content-type'); // 'application/json' echo $response->getBody(); // '{"id": 123, "name": "Ada"}'
For more examples, see the Quick Start.
Documentation
- Quick Start
- Overview
- Request Options
- Uploading Data
- Cookies
- Exceptions
- Guzzle and PSR-7
- Handlers
- Middleware
- Testing Guzzle Clients
- FAQ
- Package Ecosystem
- Upgrade Guide
- Changelog
We use GitHub issues only to discuss bugs and new features. For support, use Stack Overflow, the #guzzle channel on PHP-HTTP Slack, or Gitter.
Security
If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see Security Policy for more information.
License
Guzzle is made available under the MIT License (MIT). Please see License File for more information.
For Enterprise
Available as part of the Tidelift Subscription
The maintainers of Guzzle and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. Learn more.
