Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 7, 2024 via composer

psr/http-server-handler 1.0.2

Common interface for HTTP server-side request handler
Package summary
Share
0
issues
1
license
1
MIT
Package created
22 Jan 2018
Version published
10 Apr 2023
Maintainers
1
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-server-handler@1.0.2
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-server-handler 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does psr/http-server-handler do?

The psr/http-server-handler is an interface rather than an implementation of its own. It defines common methods that are required to build a server-side request handler in PHP, as specified by PSR-15 HTTP Server Request Handlers. HTTP server-side request handlers are an integral part of any middleware, and this interface helps to standardize the way these handlers are implemented in PHP.

How do you use psr/http-server-handler?

To use psr/http-server-handler, you need to implement the RequestHandlerInterface in your PHP class. The interface specifies a single method called handle(), which you will need to define in your class. Here's a basic example of what this might look like:

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

class YourRequestHandler implements RequestHandlerInterface
{
    public function handle(ServerRequestInterface $request): ResponseInterface
    {
        // Your code goes here.
    }
}

In this code, we create a class called YourRequestHandler that implements RequestHandlerInterface. We then define the handle() method, which is expected to take a ServerRequestInterface object and return a ResponseInterface object.

Where are the psr/http-server-handler docs?

Documentation for the psr/http-server-handler is primarily located on the official PHP-FIG website. Specifically, you can find more information about PSR-15, which the psr/http-server-handler is based on, at https://www.php-fig.org/psr/psr-15/. For more in-depth usage and implementation examples, you can check various packages listed under implementations on Packagist at https://packagist.org/providers/psr/http-server-handler-implementation.

All Versions