返回排行榜

guzzle/guzzle

PHP

Guzzle, an extensible PHP HTTP client

guzzlepsr-7httpclientcurlwebservicesphphttp-clientrequests
Star 增长趋势
Star
23.5k
Forks
2.4k
周增长
Issues
1
10k20k
2023年1月2024年3月2025年5月2026年7月
制品库Packagistcomposer require guzzle/guzzle
README

Guzzle

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

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.