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

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

modufolio/http
==============

PSR-7 HTTP message implementation with additional utilities

v0.1.0(3w ago)0277↓86.7%2MITPHPPHP ^8.2CI passing

Since Jun 5Pushed 3w agoCompare

[ Source](https://github.com/modufolio/Psr7)[ Packagist](https://packagist.org/packages/modufolio/http)[ RSS](/packages/modufolio-http/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependencies (3)Versions (2)Used By (2)

Modufolio HTTP
==============

[](#modufolio-http)

[![License: MIT](https://camo.githubusercontent.com/c2bffd81d308ced1cc3b0d66fb0ed453ab478a5e17c988b780f9de986a390ee2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](https://opensource.org/licenses/MIT) [![codecov](https://camo.githubusercontent.com/6edaeec78835792f5b82890253ecfe8989e24ee0f1d11325d4f97af806c8f469/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f6d6f6475666f6c696f2f707372373f746f6b656e3d3749543352534f56324b267374796c653d666c61742d737175617265)](https://codecov.io/gh/modufolio/psr7)

PSR-7 HTTP message implementation with additional utilities for building HTTP applications.

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

[](#installation)

```
composer require modufolio/http
```

Requirements
------------

[](#requirements)

- PHP 8.2 or higher
- PSR-7 HTTP Message interfaces
- PSR-17 HTTP Factory interfaces

Features
--------

[](#features)

This package provides a complete PSR-7 implementation including:

- **Request/Response**: Full PSR-7 HTTP message implementation
- **ServerRequest**: Server-side request handling with superglobal parsing and automatic body parsing
- **Uri**: URI parsing and manipulation
- **Stream**: Stream implementation for request/response bodies
- **UploadedFile**: File upload handling with validation
- **Emitter**: Response emitters for sending HTTP responses
- **ServerRequestCreator**: Factory for creating ServerRequest from globals
- **ServerRequestCreatorFactory**: Static factory for creating ServerRequestCreator instances
- **Static Response Helpers**: Convenient methods for creating common HTTP responses (JSON, HTML, redirects, etc.)
- **Body Parsers**: Built-in parsers for JSON, XML, and form data with extensible parser registration

Usage
-----

[](#usage)

### Creating a Response

[](#creating-a-response)

```
use Modufolio\Psr7\Http\Response;

$response = new Response(200, ['Content-Type' => 'application/json'], '{"message":"Hello"}');
```

### Creating a ServerRequest from globals

[](#creating-a-serverrequest-from-globals)

```
use Modufolio\Psr7\Http\ServerRequestCreator;

$creator = new ServerRequestCreator();
$request = $creator->fromGlobals();
```

### Working with Streams

[](#working-with-streams)

```
use Modufolio\Psr7\Http\Stream;

$stream = Stream::create('Hello World');
echo $stream->getContents(); // "Hello World"
```

### Using ServerRequestCreatorFactory

[](#using-serverrequestcreatorfactory)

```
use Modufolio\Psr7\Http\Factory\ServerRequestCreatorFactory;

$creator = ServerRequestCreatorFactory::create();
$request = $creator->fromGlobals();
```

### Static Response Helpers

[](#static-response-helpers)

```
use Modufolio\Psr7\Http\Response;

// Create JSON responses
$response = Response::json(['message' => 'Hello World'], 200);

// Create HTML responses
$response = Response::html('Hello World');

// Create redirects
$response = Response::redirect('https://example.com', 302);

// Create error responses
$response = Response::unauthorized('Invalid credentials');
$response = Response::tooManyRequests('Rate limit exceeded');
```

### Automatic Body Parsing in ServerRequest

[](#automatic-body-parsing-in-serverrequest)

```
use Modufolio\Psr7\Http\ServerRequestCreator;

$creator = new ServerRequestCreator();
$request = $creator->fromGlobals();

// Automatically parses JSON, XML, and form data
$parsedBody = $request->getParsedBody();
```

### Emitting Responses

[](#emitting-responses)

```
use Modufolio\Psr7\Http\Response;
use Modufolio\Psr7\Http\Emitter;

$response = Response::json(['status' => 'success']);
$emitter = new Emitter();
$emitter->emit($response); // Sends headers and body to client
```

License
-------

[](#license)

MIT

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance94

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

27d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/44315162577333baa74802d06e9c5dd2f3a44117b45551faa8e1d50b9d7b0c78?d=identicon)[modufolio](/maintainers/modufolio)

---

Top Contributors

[![modufolio](https://avatars.githubusercontent.com/u/18153996?v=4)](https://github.com/modufolio "modufolio (18 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

8.0k1.1B4.0k](/packages/guzzlehttp-psr7)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

85036.3k](/packages/flow-php-flow)[laudis/neo4j-php-client

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

185702.8k43](/packages/laudis-neo4j-php-client)[mezzio/mezzio

PSR-15 Middleware Microframework

3923.8M125](/packages/mezzio-mezzio)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M573](/packages/shopware-core)

PHPackages © 2026

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