PHPackages                             httpsoft/http-server-request - 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. httpsoft/http-server-request

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

httpsoft/http-server-request
============================

Infrastructure for creating PSR-7 ServerRequest and UploadedFile

1.1.1(1y ago)15127.7k↑10.5%20MITPHPPHP ^7.4|^8.0CI failing

Since Aug 23Pushed 1y ago2 watchersCompare

[ Source](https://github.com/httpsoft/http-server-request)[ Packagist](https://packagist.org/packages/httpsoft/http-server-request)[ Docs](https://httpsoft.org/)[ RSS](/packages/httpsoft-http-server-request/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (9)Dependencies (4)Versions (10)Used By (20)

HTTP Server Request
===================

[](#http-server-request)

[![License](https://camo.githubusercontent.com/a4eccf05774ba288d0b65db0c49c635dde64fea9ef615e7a1d89912dadfe2793/68747470733a2f2f706f7365722e707567782e6f72672f68747470736f66742f687474702d7365727665722d726571756573742f6c6963656e7365)](https://packagist.org/packages/httpsoft/http-server-request)[![Latest Stable Version](https://camo.githubusercontent.com/fadbc764f6d59dfa5369f1c5f7fbaef0a8737256853ce54faa6437ded6382fbd/68747470733a2f2f706f7365722e707567782e6f72672f68747470736f66742f687474702d7365727665722d726571756573742f76)](https://packagist.org/packages/httpsoft/http-server-request)[![Total Downloads](https://camo.githubusercontent.com/e416960298d2787bd63d8045d5db3e03617cca77c7cb80b88927e4d7c121caa0/68747470733a2f2f706f7365722e707567782e6f72672f68747470736f66742f687474702d7365727665722d726571756573742f646f776e6c6f616473)](https://packagist.org/packages/httpsoft/http-server-request)[![GitHub Build Status](https://github.com/httpsoft/http-server-request/workflows/build/badge.svg)](https://github.com/httpsoft/http-server-request/actions)[![GitHub Static Analysis Status](https://github.com/httpsoft/http-server-request/workflows/static/badge.svg)](https://github.com/httpsoft/http-server-request/actions)[![Scrutinizer Code Coverage](https://camo.githubusercontent.com/6e4c0c5decb0036589b02f67220fcc93d250ac3ec29c7aedc7ce6ed576e10630/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f68747470736f66742f687474702d7365727665722d726571756573742f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/httpsoft/http-server-request/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/5026f1f004fe932da7231b21f00b452a4379d9e7fe2684b477dbc73fca1221ad/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f68747470736f66742f687474702d7365727665722d726571756573742f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/httpsoft/http-server-request/?branch=master)

This package makes it easy and flexible to create PSR-7 components [ServerRequest](https://github.com/php-fig/http-message/blob/master/src/ServerRequestInterface.php) and [UploadedFile](https://github.com/php-fig/http-message/blob/master/src/UploadedFileInterface.php).

Depends on the [httpsoft/http-message](https://github.com/httpsoft/http-message) package.

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

[](#documentation)

- [In English language](https://httpsoft.org/docs/server-request).
- [In Russian language](https://httpsoft.org/ru/docs/server-request).

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

[](#installation)

This package requires PHP version 7.4 or later.

```
composer require httpsoft/http-server-request

```

Usage ServerRequestCreator
--------------------------

[](#usage-serverrequestcreator)

```
use HttpSoft\ServerRequest\ServerRequestCreator;

// All necessary data will be received automatically:
$request = ServerRequestCreator::createFromGlobals($_SERVER, $_FILES, $_COOKIE, $_GET, $_POST);
// equivalently to:
$request = ServerRequestCreator::createFromGlobals();
// equivalently to:
$request = ServerRequestCreator::create();
```

By default [HttpSoft\\ServerRequest\\SapiNormalizer](https://github.com/httpsoft/http-server-request/blob/master/src/SapiNormalizer.php) is used for normalization of server parameters. You can use your own server parameters normalizer, for this you need to implement an [HttpSoft\\ServerRequest\\ServerNormalizerInterface](https://github.com/httpsoft/http-server-request/blob/master/src/ServerNormalizerInterface.php) interface.

```
$normalizer = new YouCustomServerNormalizer();

$request = ServerRequestCreator::create($normalizer);
// equivalently to:
$request = ServerRequestCreator::createFromGlobals($_SERVER, $_FILES, $_COOKIE, $_GET, $_POST, $normalizer);
// or with custom superglobals:
$request = ServerRequestCreator::createFromGlobals($server, $files, $cookie, $get, $post, $normalizer);
```

Usage UploadedFileCreator
-------------------------

[](#usage-uploadedfilecreator)

```
use HttpSoft\ServerRequest\UploadedFileCreator;

/** @var StreamInterface|string|resource $streamOrFile */
$uploadedFile = UploadedFileCreator::create($streamOrFile, 1024, UPLOAD_ERR_OK, 'file.txt', 'text/plain');

// Create a new `HttpSoft\UploadedFile\UploadedFile` instance from array (the item `$_FILES`)
$uploadedFile = UploadedFileCreator::createFromArray([
    'name' => 'filename.jpg', // optional
    'type' => 'image/jpeg', // optional
    'tmp_name' => '/tmp/php/php6hst32',
    'error' => 0, // UPLOAD_ERR_OK
    'size' => 98174,
]);

// Normalizes the superglobal structure and converts each array
// value to an instance of `Psr\Http\Message\UploadedFileInterface`.
$uploadedFiles = UploadedFileCreator::createFromGlobals($_FILES);
```

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 98.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 ~194 days

Recently: every ~361 days

Total

9

Last Release

586d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7ab952aaa5ac8f82d6e96ef74c2f69082674a97eb3bc62f9d96c7304b2b4b082?d=identicon)[devanych](/maintainers/devanych)

---

Top Contributors

[![devanych](https://avatars.githubusercontent.com/u/20116244?v=4)](https://github.com/devanych "devanych (55 commits)")[![8ctopus](https://avatars.githubusercontent.com/u/13252042?v=4)](https://github.com/8ctopus "8ctopus (1 commits)")

---

Tags

httphttp-messagehttp-server-requestphppsr-7server-requesthttppsr-7http-messagephphttp-server-request

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/httpsoft-http-server-request/health.svg)

```
[![Health](https://phpackages.com/badges/httpsoft-http-server-request/health.svg)](https://phpackages.com/packages/httpsoft-http-server-request)
```

###  Alternatives

[fig/http-message-util

Utility classes and constants for use with PSR-7 (psr/http-message)

39397.5M314](/packages/fig-http-message-util)[httpsoft/http-message

Strict and fast implementation of PSR-7 and PSR-17

87965.9k114](/packages/httpsoft-http-message)[httpsoft/http-basis

Simple and fast HTTP microframework implementing PSR standards

1343.1k1](/packages/httpsoft-http-basis)

PHPackages © 2026

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