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

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

innmind/http
============

Value Objects to abstract http messages

9.0.0(3mo ago)4108.6k↓27%9MITPHPPHP ~8.4CI passing

Since May 4Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/Innmind/Http)[ Packagist](https://packagist.org/packages/innmind/http)[ Docs](http://github.com/Innmind/Http)[ RSS](/packages/innmind-http/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (10)Dependencies (12)Versions (66)Used By (9)

Http
====

[](#http)

[![Build Status](https://github.com/innmind/http/workflows/CI/badge.svg?branch=master)](https://github.com/innmind/http/actions?query=workflow%3ACI)[![codecov](https://camo.githubusercontent.com/70b451a1035616dfb8f7a27414f00c75c3c2261ca7b6ffaa3a10a929e7dead2b/68747470733a2f2f636f6465636f762e696f2f67682f696e6e6d696e642f687474702f6272616e63682f646576656c6f702f67726170682f62616467652e737667)](https://codecov.io/gh/innmind/http)[![Type Coverage](https://camo.githubusercontent.com/01dfbed0f86724a27fc51a338640170e31d3f2f4b4cc34af0bd4d3baee208682/68747470733a2f2f73686570686572642e6465762f6769746875622f696e6e6d696e642f687474702f636f7665726167652e737667)](https://shepherd.dev/github/innmind/http)

Immutable value objects and interfaces to abstract http messages.

**Important**: you must use [`vimeo/psalm`](https://packagist.org/packages/vimeo/psalm) to make sure you use this library correctly.

Build a `ServerRequest`
-----------------------

[](#build-a-serverrequest)

```
use Innmind\Http\Factory\ServerRequestFactory;
use Innmind\TimeContinuum\Clock;

$request = ServerRequestFactory::native(Clock::live())();
```

Send a `Response`
-----------------

[](#send-a-response)

```
use Innmind\Http\{
    Response,
    Response\StatusCode,
    Response\Sender\Native,
    ProtocolVersion,
    Headers,
    Header,
    Header\ContentType,
};
use Innmind\Filesystem\File\Content;
use Innmind\TimeContinuum\Clock;

$response = Response::of(
    StatusCode::ok,
    ProtocolVersion::v11,
    Headers::of(
        ContentType::of('application', 'json'),
    ),
    Content::ofString('{"some": "data"}'),
);

Native::of(Clock::live()))($response);
```

will build the following message:

```
HTTP/1.1 200 OK
Date: Wed, 04 May 2016 14:24:14 +0000
Content-Type : application/json

{"some": "data"}

```

Build a multipart `Request`
---------------------------

[](#build-a-multipart-request)

```
use Innmind\Http\{
    Request,
    Method,
    Content\Multipart,
    Header\ContentType\Boundary,
    Headers,
    ProtocolVersion,
};
use Innmind\Filesystem\{
    File,
    File\Content,
};
use Innmind\Url\Url;

$boundary = Boundary::uuid();
$request = Request::of(
    Url::of('http://some-server.com/')
    Method::post,
    ProtocolVersion::v11,
    Headers::of($boundary->toHeader()),
    Multipart::boundary($boundary)
        ->with('some[key]', 'some value')
        ->withFile('some[file]', File::named(
            'whatever.txt',
            Content::ofString(' can be any file content'),
        )),
);
```

###  Health Score

62

—

FairBetter than 99% of packages

Maintenance80

Actively maintained with recent releases

Popularity36

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity95

Battle-tested with a long release history

 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

Every ~60 days

Recently: every ~208 days

Total

60

Last Release

106d ago

Major Versions

4.5.1 → 5.0.02022-02-22

5.3.1 → 6.0.02023-01-29

6.4.0 → 7.0.02023-10-22

7.1.0 → 8.0.02025-04-20

8.0.0 → 9.0.02026-02-01

PHP version history (7 changes)1.0.0PHP &gt;=7.0

2.0.0PHP ~7.1

4.0.0PHP ~7.4

4.5.0PHP ~7.4|~8.0

5.0.0PHP ~8.1

6.4.0PHP ~8.2

9.0.0PHP ~8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/851425?v=4)[Baptiste Langlade](/maintainers/Baptouuuu)[@Baptouuuu](https://github.com/Baptouuuu)

---

Top Contributors

[![Baptouuuu](https://avatars.githubusercontent.com/u/851425?v=4)](https://github.com/Baptouuuu "Baptouuuu (578 commits)")

---

Tags

httpValue Object

### Embed Badge

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

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

###  Alternatives

[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

7.9k1.0B3.2k](/packages/guzzlehttp-psr7)[psr/http-message

Common interface for HTTP messages

7.1k1.0B5.5k](/packages/psr-http-message)[psr/http-factory

PSR-17: Common interfaces for PSR-7 HTTP message factories

1.9k692.9M1.9k](/packages/psr-http-factory)[psr/http-client

Common interface for HTTP clients

1.7k680.7M2.1k](/packages/psr-http-client)[psr/link

Common interfaces for HTTP links

2.5k144.1M68](/packages/psr-link)[rmccue/requests

A HTTP library written in PHP, for human beings.

3.6k34.5M258](/packages/rmccue-requests)

PHPackages © 2026

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