Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Psr7 Laravel Package

guzzlehttp/psr7

PSR-7 HTTP message implementation for PHP: request, response, URI, uploaded file, and stream objects compatible with Guzzle and any PSR-7 library. Create or inspect messages without sending requests; includes factories and helpers.

View on GitHub
Deep Wiki
Context7

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 instead; it already depends on this package.

Installation

composer require guzzlehttp/psr7

Version Guidance

Version Status PHP Version
3.1 Latest >=7.4,<8.7
2.13 Maintenance >=7.2.5,<8.7
1.9 End of Life >=5.4,<8.2

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

Security

If you discover a security vulnerability within this package, please send an email to [email protected]. 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.

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator
equipc/laravel-email-database-log
adedsec/nova-translated-labels