PHPackages                             ray/http-message - 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. ray/http-message

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

ray/http-message
================

PSR7 module for Ray.Di

1.4.0(3mo ago)0200.6k↓19.5%1MITPHPPHP ^8.1CI passing

Since Nov 12Pushed 3mo ago2 watchersCompare

[ Source](https://github.com/ray-di/Ray.Psr7Module)[ Packagist](https://packagist.org/packages/ray/http-message)[ RSS](/packages/ray-http-message/feed)WikiDiscussions 1.x Synced 1mo ago

READMEChangelog (8)Dependencies (6)Versions (10)Used By (0)

Ray.Psr7Module
==============

[](#raypsr7module)

[![Code Coverage](https://camo.githubusercontent.com/37db80c58548fea6afd7511637e4a5b1680f30adcfe44e3af766e6314be3eb6b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7261792d64692f5261792e507372374d6f64756c652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/ray-di/Ray.Psr7Module/?branch=master)[![Continuous Integration](https://github.com/ray-di/Ray.Psr7Module/workflows/Continuous%20Integration/badge.svg)](https://github.com/ray-di/Ray.Psr7Module/workflows/Continuous%20Integration/badge.svg)

Overview
--------

[](#overview)

`Ray.Psr7Module` provides `RequestProvider` to get the [PSR7 ServerRequest](https://github.com/php-fig/http-message/blob/master/src/ServerRequestInterface.php) object.

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

[](#installation)

### Composer install

[](#composer-install)

```
$ composer require ray/psr7-module

```

### Module install

[](#module-install)

```
use Ray\Di\AbstractModule;
use Ray\Psr7Module;

class AppModule extends AbstractModule
{
    protected function configure()
    {
        $this->install(new Psr7Module);
    }
}
```

Usage
-----

[](#usage)

### ServerRequest (general)

[](#serverrequest-general)

```
class Foo
{
    public function __construct(ServerRequestInterface $serverRequest)
    {
        // retrieve cookies
        $cookie = $serverRequest->getCookieParams(); // $_COOKIE
    }
}
```

### URI

[](#uri)

```
use Psr\Http\Message\UriInterface;

class Foo
{
    public function __construct(UriInterface $uri)
    {
        // retrieve host name
        $host = $uri->getHost();
    }
}
```

### Upload Files

[](#upload-files)

```
use Psr\Http\Message\UploadedFileInterface;
use Ray\HttpMessage\Annotation\UploadFiles;

class Foo
{
    public function __construct(
        #[UploadFiles] array $files
    ) {
        // retrieve file name
        $file = $files['my-form']['details']['avatar'][0];
        /* @var UploadedFileInterface $file */
        $name = $file->getClientFilename(); // my-avatar3.png
    }
}
```

### Lazy Loading

[](#lazy-loading)

If you want to lazy load the `ServerRequest`, use `Ray\Di\Di\Set` attribute.

```
use Ray\Di\Di\Set;
use Ray\Di\ProviderInterface;
use Psr\Http\Message\ServerRequestInterface;

class Foo
{
    public function __construct(
        #[Set(ServerRequestInterface::class)] private ProviderInterface $requestProvider
    ) {}

    public function onGet()
    {
        $request = $this->requestProvider->get();
    }
}
```

###  Health Score

54

—

FairBetter than 97% of packages

Maintenance79

Regular maintenance activity

Popularity34

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity76

Established project with proven stability

 Bus Factor1

Top contributor holds 93.2% of commits — single point of failure

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 ~329 days

Recently: every ~456 days

Total

9

Last Release

110d ago

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

1.3.0PHP ^7.3 || ^8.0

1.4.0PHP ^8.1

### Community

Maintainers

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

---

Top Contributors

[![koriym](https://avatars.githubusercontent.com/u/529021?v=4)](https://github.com/koriym "koriym (69 commits)")[![jingu](https://avatars.githubusercontent.com/u/892913?v=4)](https://github.com/jingu "jingu (5 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ray-http-message/health.svg)

```
[![Health](https://phpackages.com/badges/ray-http-message/health.svg)](https://phpackages.com/packages/ray-http-message)
```

###  Alternatives

[league/uri-interfaces

Common tools for parsing and resolving RFC3987/RFC3986 URI

536204.9M23](/packages/league-uri-interfaces)[shopify/shopify-api

Shopify API Library for PHP

4634.8M16](/packages/shopify-shopify-api)[laudis/neo4j-php-client

Neo4j-PHP-Client is the most advanced PHP Client for Neo4j

184616.9k31](/packages/laudis-neo4j-php-client)[jaxon-php/jaxon-core

Jaxon is an open source PHP library for easily creating Ajax web applications

73142.3k25](/packages/jaxon-php-jaxon-core)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[open-telemetry/opentelemetry-auto-wordpress

OpenTelemetry auto-instrumentation for Wordpress

17166.0k](/packages/open-telemetry-opentelemetry-auto-wordpress)

PHPackages © 2026

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