PHPackages                             guzzlehttp/psr7 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. guzzlehttp/psr7

ActiveLibrary[HTTP &amp; Networking](/categories/http)

guzzlehttp/psr7
===============

PSR-7 message implementation that also provides common utility methods

3.0.0(4w ago)7.9k1.1B↓27.4%23[2 issues](https://github.com/guzzle/psr7/issues)20MITPHPPHP ^7.4 || ^8.0CI passing

Since May 19Pushed 1w ago36 watchersCompare

[ Source](https://github.com/guzzle/psr7)[ Packagist](https://packagist.org/packages/guzzlehttp/psr7)[ GitHub Sponsors](https://github.com/GrahamCampbell)[ GitHub Sponsors](https://github.com/Nyholm)[ RSS](/packages/guzzlehttp-psr7/feed)WikiDiscussions 3.0 Synced 2w ago

READMEChangelog (10)Dependencies (52)Versions (223)Used By (20)Security (6)

Guzzle PSR-7
============

[](#guzzle-psr-7)

`guzzlehttp/psr7` is a PSR-7 HTTP message implementation for PHP. It provides request, response, URI, uploaded file, and stream objects that work with Guzzle and any other library using the PSR-7 interfaces.

Use this package directly when you need to create or inspect PSR-7 messages without sending HTTP requests. If you only want to make HTTP requests, install [`guzzlehttp/guzzle`](https://github.com/guzzle/guzzle/blob/8.0/README.md)instead; it already depends on this package.

Installation
------------

[](#installation)

```
composer require guzzlehttp/psr7
```

Version Guidance
----------------

[](#version-guidance)

VersionStatusPHP Version3.0Latest&gt;=7.4,&lt;8.62.13Maintenance&gt;=7.2.5,&lt;8.61.9End of Life&gt;=5.4,&lt;8.2Quick Start
-----------

[](#quick-start)

```
use GuzzleHttp\Psr7\Request;
use GuzzleHttp\Psr7\Response;
use GuzzleHttp\Psr7\Utils;

$request = new Request('GET', 'https://example.com/api');
$response = new Response(200, ['Content-Type' => 'text/plain'], 'OK');
$stream = Utils::streamFor('request or response body');

echo $request->getMethod();
echo $response->getStatusCode();
echo $stream;
```

PSR-7 messages and URIs are immutable. Methods such as `withHeader()` and `withUri()` return a changed copy instead of modifying the original object. Streams are mutable body handles; reading, writing, seeking, and closing a stream can change its cursor, contents, or usability.

```
$request = $request->withHeader('Accept', 'application/json');
```

Documentation
-------------

[](#documentation)

- [PSR-7 Messages](docs/psr-7-messages.md)
- [Streams and Decorators](docs/streams-and-decorators.md)
- [URI Helpers](docs/uri-helpers.md)
- [PSR-17 Factories](docs/psr-17-factories.md)
- [Message Helpers](docs/message-helpers.md)
- [Diagnostic Values](docs/diagnostic-values.md)
- [Header and Query Helpers](docs/header-and-query-helpers.md)
- [Stream Helpers](docs/stream-helpers.md)
- [URI and MIME Helpers](docs/uri-and-mime-helpers.md)
- [Upgrade Guide](UPGRADING.md)
- [Changelog](CHANGELOG.md)

Security
--------

[](#security)

If you discover a security vulnerability within this package, please send an email to . 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](https://github.com/guzzle/psr7/security/policy) for more information.

License
-------

[](#license)

Guzzle is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information.

For Enterprise
--------------

[](#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.](https://tidelift.com/subscription/pkg/packagist-guzzlehttp-psr7?utm_source=packagist-guzzlehttp-psr7&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)

###  Health Score

85

—

ExcellentBetter than 100% of packages

Maintenance96

Actively maintained with recent releases

Popularity84

Widely adopted with strong download metrics

Community64

Healthy contributor diversity

Maturity88

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~51 days

Recently: every ~2 days

Total

81

Last Release

22d ago

Major Versions

1.8.4 → 2.1.12022-03-20

1.8.5 → 2.1.22022-03-20

1.9.0 → 2.4.02022-06-20

1.9.1 → 2.4.x-dev2023-04-17

2.13.0 → 3.0.02026-07-20

PHP version history (3 changes)1.0.0PHP &gt;=5.4.0

2.0.0-beta1PHP ^7.2.5 || ^8.0

3.0.0PHP ^7.4 || ^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/190930?v=4)[Michael Dowling](/maintainers/mtdowling)[@mtdowling](https://github.com/mtdowling)

![](https://www.gravatar.com/avatar/184fbc398ff1b83855ab8289cd8ce20225d0158c66284b458d2d811546606938?d=identicon)[jeremeamia](/maintainers/jeremeamia)

![](https://www.gravatar.com/avatar/401ccc5eea13c60cf807ae982af00e368e2166e2f26d8eb541dcd881a57385bc?d=identicon)[Nyholm](/maintainers/Nyholm)

![](https://www.gravatar.com/avatar/0e4e105cea62b616d4cb376b08a849b6a428f646998537de150d16a8eb537b90?d=identicon)[mark.sagikazar](/maintainers/mark.sagikazar)

![](https://www.gravatar.com/avatar/d10b19f74fa2f712a4fbb9d9073c95d612c0f32e6ba95aed6f68e589c8e2688e?d=identicon)[Tobion](/maintainers/Tobion)

![](https://www.gravatar.com/avatar/d95eb26cb8f3919bb5ca3b6d823daeabbf259663778a970349b245c580713c8e?d=identicon)[graham-campbell](/maintainers/graham-campbell)

---

Top Contributors

[![GrahamCampbell](https://avatars.githubusercontent.com/u/2829600?v=4)](https://github.com/GrahamCampbell "GrahamCampbell (423 commits)")[![Tobion](https://avatars.githubusercontent.com/u/610090?v=4)](https://github.com/Tobion "Tobion (150 commits)")[![mtdowling](https://avatars.githubusercontent.com/u/190930?v=4)](https://github.com/mtdowling "mtdowling (92 commits)")[![sagikazarmark](https://avatars.githubusercontent.com/u/1226384?v=4)](https://github.com/sagikazarmark "sagikazarmark (89 commits)")[![Nyholm](https://avatars.githubusercontent.com/u/1275206?v=4)](https://github.com/Nyholm "Nyholm (29 commits)")[![gmponos](https://avatars.githubusercontent.com/u/5675248?v=4)](https://github.com/gmponos "gmponos (27 commits)")[![TimWolla](https://avatars.githubusercontent.com/u/209270?v=4)](https://github.com/TimWolla "TimWolla (14 commits)")[![ivank](https://avatars.githubusercontent.com/u/4976?v=4)](https://github.com/ivank "ivank (13 commits)")[![jeskew](https://avatars.githubusercontent.com/u/705500?v=4)](https://github.com/jeskew "jeskew (12 commits)")[![jeremeamia](https://avatars.githubusercontent.com/u/107867?v=4)](https://github.com/jeremeamia "jeremeamia (8 commits)")[![reedy](https://avatars.githubusercontent.com/u/67615?v=4)](https://github.com/reedy "reedy (4 commits)")[![albe](https://avatars.githubusercontent.com/u/4259532?v=4)](https://github.com/albe "albe (4 commits)")[![trowski](https://avatars.githubusercontent.com/u/1628287?v=4)](https://github.com/trowski "trowski (4 commits)")[![BenMorel](https://avatars.githubusercontent.com/u/1952838?v=4)](https://github.com/BenMorel "BenMorel (4 commits)")[![zyfran](https://avatars.githubusercontent.com/u/100966?v=4)](https://github.com/zyfran "zyfran (3 commits)")[![kkopachev](https://avatars.githubusercontent.com/u/2279051?v=4)](https://github.com/kkopachev "kkopachev (3 commits)")[![uda](https://avatars.githubusercontent.com/u/199314?v=4)](https://github.com/uda "uda (3 commits)")[![marius-c](https://avatars.githubusercontent.com/u/5131582?v=4)](https://github.com/marius-c "marius-c (2 commits)")[![Kevinrob](https://avatars.githubusercontent.com/u/4509277?v=4)](https://github.com/Kevinrob "Kevinrob (2 commits)")[![northys](https://avatars.githubusercontent.com/u/2878126?v=4)](https://github.com/northys "northys (2 commits)")

---

Tags

httpresponserequestpsr-7streamurlmessageuri

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/guzzlehttp-psr7/health.svg)

```
[![Health](https://phpackages.com/badges/guzzlehttp-psr7/health.svg)](https://phpackages.com/packages/guzzlehttp-psr7)
```

###  Alternatives

[drupal/core-recommended

Locked core dependencies; require this project INSTEAD OF drupal/core.

6943.5M449](/packages/drupal-core-recommended)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.8M674](/packages/shopware-core)[pdeans/http

PSR-7 cURL HTTP client with support for PSR-17 HTTP factories.

1466.6k3](/packages/pdeans-http)[workerman/psr7

PSR-7 message implementation that also provides common utility methods

1095.6k13](/packages/workerman-psr7)[chillerlan/php-httpinterface

A PSR-7/17/18 http message/client implementation

1419.2k8](/packages/chillerlan-php-httpinterface)[art4/requests-psr18-adapter

Use WordPress/Requests as a PSR-18 HTTP client

159.3k](/packages/art4-requests-psr18-adapter)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
