guzzlehttp / guzzle
Guzzle is a PHP HTTP client library
Fund package maintenance!
Nyholm
GrahamCampbell
Tidelift
Installs: 763 014 735
Dependents: 32 718
Suggesters: 659
Security: 6
Stars: 23 226
Watchers: 450
Forks: 2 402
Open Issues: 42
Requires
- php: ^7.2.5 || ^8.0
- ext-json: *
- guzzlehttp/promises: ^1.5.3 || ^2.0.3
- guzzlehttp/psr7: ^2.7.0
- psr/http-client: ^1.0
- symfony/deprecation-contracts: ^2.2 || ^3.0
Requires (Dev)
- ext-curl: *
- bamarni/composer-bin-plugin: ^1.8.2
- guzzle/client-integration-tests: 3.0.2
- php-http/message-factory: ^1.1
- phpunit/phpunit: ^8.5.39 || ^9.6.20
- psr/log: ^1.1 || ^2.0 || ^3.0
Suggests
- ext-curl: Required for CURL handler support
- ext-intl: Required for Internationalized Domain Name (IDN) support
- psr/log: Required for using the Log middleware
Provides
- 8.0.x-dev
- 7.9.x-dev
- 7.9.2
- 7.9.1
- 7.9.0
- 7.8.x-dev
- 7.8.2
- 7.8.1
- 7.8.0
- 7.7.x-dev
- 7.7.1
- 7.7.0
- 7.6.x-dev
- 7.6.1
- 7.6.0
- 7.5.x-dev
- 7.5.3
- 7.5.2
- 7.5.1
- 7.5.0
- 7.4.5
- 7.4.4
- 7.4.3
- 7.4.2
- 7.4.1
- 7.4.0
- 7.3.0
- 7.2.0
- 7.1.1
- 7.1.0
- 7.0.1
- 7.0.0
- 7.0.0-rc.1
- 7.0.0-beta.2
- 7.0.0-beta.1
- 6.5.x-dev
- 6.5.8
- 6.5.7
- 6.5.6
- 6.5.5
- 6.5.4
- 6.5.3
- 6.5.2
- 6.5.1
- 6.5.0
- 6.4.1
- 6.4.0
- 6.3.3
- 6.3.2
- 6.3.1
- 6.3.0
- 6.2.3
- 6.2.2
- 6.2.1
- 6.2.0
- 6.1.1
- 6.1.0
- 6.0.2
- 6.0.1
- 6.0.0
- 5.3.x-dev
- 5.3.4
- 5.3.3
- 5.3.2
- 5.3.1
- 5.3.0
- 5.2.0
- 5.1.0
- 5.0.3
- 5.0.2
- 5.0.1
- 5.0.0
- 4.x-dev
- 4.2.4
- 4.2.3
- 4.2.2
- 4.2.1
- 4.2.0
- 4.1.8
- 4.1.7
- 4.1.6
- 4.1.5
- 4.1.4
- 4.1.3
- 4.1.2
- 4.1.1
- 4.1.0
- 4.0.2
- 4.0.1
- 4.0.0
- 4.0.0-rc.2
- 4.0.0-rc.1
- v3.8.1
- v3.8.0
- v3.7.4
- v3.7.3
- v3.7.2
- v3.7.1
- v3.7.0
- v3.6.0
- v3.5.0
- v3.4.3
- v3.4.2
- v3.4.1
- v3.4.0
- v3.3.1
- v3.3.0
- v3.2.0
- v3.1.2
- v3.1.1
- v3.1.0
- v3.0.7
- v3.0.6
- v3.0.5
- v3.0.4
- v3.0.3
- v3.0.2
- v3.0.1
- v3.0.0
- v2.8.8
- v2.8.7
- v2.8.6
- v2.8.5
- v2.8.4
- v2.8.3
- v2.8.2
- v2.8.1
- v2.8.0
- v2.7.2
- v2.7.1
- v2.7.0
- v2.6.6
- v2.6.5
- v2.6.4
- v2.6.3
- v2.6.2
- v2.6.1
- v2.6.0
- v2.5.0
- v2.4.1
- v2.4.0
- v2.3.2
- v2.2.4
- v2.2.3
- v2.2.2
- v2.2.1
- v2.2.0
- v2.1.4
- v2.1.3
- v2.1.2
- v2.1.1
- v2.1.0
- v2.0.5
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- v1.0.4
- v1.0.3
- dev-set-cookie-typing
- dev-test
This package is auto-updated.
Last update: 2024-12-02 13:04:24 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 between 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.
$client = new \GuzzleHttp\Client(); $response = $client->request('GET', 'https://api.github.com/repos/guzzle/guzzle'); echo $response->getStatusCode(); // 200 echo $response->getHeaderLine('content-type'); // 'application/json; charset=utf8' echo $response->getBody(); // '{"id": 1420053, "name": "guzzle", ...}' // Send an asynchronous request. $request = new \GuzzleHttp\Psr7\Request('GET', 'http://httpbin.org'); $promise = $client->sendAsync($request)->then(function ($response) { echo 'I completed! ' . $response->getBody(); }); $promise->wait();
Help and docs
We use GitHub issues only to discuss bugs and new features. For support please refer to:
- Documentation
- Stack Overflow
- #guzzle channel on PHP-HTTP Slack
- Gitter
Installing Guzzle
The recommended way to install Guzzle is through Composer.
composer require guzzlehttp/guzzle
Version Guidance
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.