Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 8, 2024 via composer

psr/http-message 2.0

Common interface for HTTP messages
Package summary
Share
0
issues
1
license
1
MIT
Package created
10 Jun 2014
Version published
4 Apr 2023
Maintainers
3
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
psr/http-message@2.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of psr/http-message 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does psr/http-message do?

The psr/http-message is a PHP standard recommendation package that provides a common interface for HTTP messages. It serves as an abstract layer for a HTTP message, but doesn't implement a HTTP message of its own. It's crucial to note that this package is all about defining standardized rules for dealing with HTTP requests and responses in PHP, which makes the interoperability among different PHP libraries and frameworks easier.

How do you use psr/http-message?

Using the psr/http-message package involves implementing it in conjunction with other packages that provide an implementation of HTTP messages. Here is a simple example, assuming you are using some package that relies on psr/http-message:

<?php

use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;

function (ServerRequestInterface $request): ResponseInterface
{
    $response = new \SomeVendor\ImplementationOfPsr7\Response();
    $response->getBody()->write("Hello, world!");

    return $response;
}

In the code example above, we are using the ServerRequestInterface and ResponseInterface which are part of the psr/http-message standard. We are creating a new response and writing a body to it.

Remember that the actual functionality will come from the specific implementation that you use in conjunction with psr/http-message, such as Slim, Guzzle, Symfony, etc.

Where are the psr/http-message docs?

The documentation for the psr/http-message package, including information on the methods for PSR-7 interfaces and usage guidelines, can be found exclusively on the psr/http-message GitHub repository. The specific documents are PSR-7 Interfaces Method List and the PSR-7 Usage Guide.