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(5mo ago)4114.7k↓57.9%9MITPHPPHP ~8.4CI passing

Since May 4Pushed 2mo 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 2d 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

61

—

FairBetter than 98% of packages

Maintenance79

Regular maintenance activity

Popularity34

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

152d 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 (579 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

[domraider/rxnet

Rx connector for PHP

1318.6k2](/packages/domraider-rxnet)[markocupic/calendar-event-booking-bundle

Contao Calendar Event Booking Bundle

135.2k1](/packages/markocupic-calendar-event-booking-bundle)

PHPackages © 2026

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