Guzzle
An extensible PHP HTTP client for sending requests and integrating with web services
Repository Health
Technical Analysis
Guzzle is a PHP HTTP client that makes it simple to send HTTP requests and trivial to integrate with web services. It offers one interface for both synchronous and asynchronous requests, builds on the PSR-7 message and PSR-18 client standards for interoperability, and abstracts away the underlying transport so your code never depends directly on cURL or PHP streams.
A composable middleware system lets you augment client behavior with retries, redirects, logging, and cookies, while promises make concurrent requests straightforward. With billions of downloads and near-universal adoption across the PHP ecosystem, Guzzle is the de facto standard HTTP client for the language.
What You Get
- A simple, immutable
Clientfor building and sending synchronous and asynchronous HTTP requests - Full PSR-7 (messages) and PSR-18 (HTTP client) compliance for framework and library interoperability
- A pluggable handler and middleware stack for retries, redirects, cookies, and logging
- Promise-based concurrency for pooling and multiplexing many requests at once
- Transport abstraction over cURL and PHP streams so code stays environment-agnostic
Common Use Cases
- Consuming REST and JSON APIs from PHP applications and services
- Making concurrent or pooled requests to speed up bulk data fetching
- Building SDKs and API clients that need retries, auth, and error handling
- Streaming large uploads and downloads without exhausting memory
Under The Hood
Architecture - A request enters through the immutable Client (src/Client.php), which merges default options and delegates to a HandlerStack that wraps a base transport handler in a chain of middleware (redirects, retries, cookies, body preparation). The handler returns a PromiseInterface, so the same code path serves both blocking request() and non-blocking sendAsync() calls; Pool and multiplexing coordinate many in-flight promises. Handlers under src/Handler (CurlHandler, CurlMultiHandler, StreamHandler, MockHandler) isolate the actual transport behind a common callable contract.
Tech Stack - Pure PHP targeting ^7.2.5 || ^8.0, built on the guzzlehttp/promises and guzzlehttp/psr7 packages plus the psr/http-client interface, with symfony deprecation-contracts and polyfills. cURL is an optional runtime dependency (ext-curl) with a PHP-stream fallback. Tooling includes PHPUnit, PHPStan (with a baseline), and php-cs-fixer, orchestrated via a Makefile and composer bin plugin.
Code Quality - The codebase is small and focused (47 source files) with an extensive test suite (41 test files) covering handlers, middleware, and integration scenarios against a test server. Interfaces are defined for every major seam (ClientInterface, CurlFactoryInterface, MessageFormatterInterface), dedicated exception types model transfer and HTTP errors, and PHPStan enforces static typing. Naming is consistent and the public surface is documented inline.
API Design - The developer experience is deliberately minimal: construct a Client, call request('GET', $uri), and read a PSR-7 response. Request options are passed as a plain associative array, keeping the getting-started path to a couple of lines, while advanced needs (middleware, custom handlers, promises) are available without complicating the common case. Documentation is thorough, with a quickstart, request-options reference, and testing guide.
Used by 31 apps in this directory
LinkStack
Marketing
Self-hosted, privacy-focused Linktree alternative with themes, analytics, and a drag-and-drop admin panel.
Magic
AI Agents · Automation · Low Code Platforms
Magic is an enterprise-grade open-source AI agent platform combining a generalist AI agent, workflow engine, IM, and collaborative office system for running an AI-powered digital workforce.
Mautic
Automation · Ecommerce · Marketing
The world's largest open source marketing automation platform — own your data, run multi-channel campaigns, and escape vendor lock-in forever.
Mixpost
Marketing · Social Media
Self-host your own social media scheduler and publish to 11 platforms without subscriptions or data lock-in.
opencloud
File Storage
Open source file management and collaboration platform that keeps your data under your control, no database required.
Open Web Analytics
Analytics
Self-host your own Google Analytics alternative with heatmaps, session recordings, and full data ownership — no cloud required.
OpnForm
Forms Surveys · Marketing
Build unlimited, embeddable forms with no code — powered by AI, logic rules, and real-time analytics
Pixelfed
Social Media
A decentralized, self-hosted photo sharing platform built on ActivityPub for the open Fediverse.
SendPortal
Marketing
Self-hosted email marketing with full data control, multi-workspace isolation, and seamless integration with Amazon SES, SendGrid, Mailgun, and more