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

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

umber/http
==========

A series of helper HTTP classes and implementation.

2.0.1(7y ago)15.5k2MITPHPPHP &gt;=7.1

Since Dec 19Pushed 7y ago1 watchersCompare

[ Source](https://github.com/umber/http)[ Packagist](https://packagist.org/packages/umber/http)[ RSS](/packages/umber-http/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (4)Dependencies (9)Versions (8)Used By (2)

Umber HTTP
==========

[](#umber-http)

A series of light weight abstractions around crafting HTTP responses.

MasterDevelop[![Build Status](https://camo.githubusercontent.com/9cf4331b0307560a25e12aae2e3a10f8a102c1c3cd88512be1bf57a4f3041540/68747470733a2f2f7472617669732d63692e636f6d2f756d6265722f687474702e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/umber/http)[![Build Status](https://camo.githubusercontent.com/1016ec833e2272e6724f1ed9a46a3c35c1159ae91f553af0616a6104e000ba60/68747470733a2f2f7472617669732d63692e636f6d2f756d6265722f687474702e7376673f6272616e63683d646576656c6f70)](https://travis-ci.com/umber/http)Installation
------------

[](#installation)

The package can be installed through composer through [Packagist](https://packagist.org/packages/umber/http):

- `composer require umber/http`

Please anchor the version to `2.x` as version `1.x` is not supported anymore.

Usage
-----

[](#usage)

A HTTP response is represented by an implementation of `HttpResponseInterface`. These classes implement basic concepts of a HTTP response and can be used to compile a valid response for use OR can be converted to your framework of choice.

The following classes are at its core:

- `Umber\Http\Header\HttpHeaderInterface`
- `Umber\Http\Response\HttResponseInterface`

Basic implementations of these classes exist:

- `Umber\Http\Header\HttpHeader`
- `Umber\Http\Response\HttpResponse`
- `Umber\Http\Response\Type\JsonHttpResponse`

Currently the only format this package supports out of the box is `json`. This is not a design limitation but because the package was originally designed with an API focus. For working with `json` the following classes are available:

- `Umber\Http\Factory\Type\JsonHttpResponseFactoryInterface`
- `Umber\Http\Factory\Type\JsonHttpResponseFactory`
- `Umber\Http\Factory\Type\JsonHttpResponseGenerator`
- `Umber\Http\Response\Type\JsonHttpResponse`

Abstractions around the following API concepts are also implemented:

- `Serialization`
- `Pagination`

### Serialization

[](#serialization)

For requests that are used in API context you may want to invoke a serializer. This package does not provide a serialization implementation but an abstraction to interact with one of your choice.

A `HttpResponseInterface` tailored for serialization is provided:

- `Umber\Http\Serializer\Response\SerializerHttpResponse`

This response requires an instance of `HttpResponseSerializerInterface` is provided along with any serialization groups. The data given to the response is the raw data to be serialized. When the response is used to get the body it will serialize the data at that point.

**NOTE**, when using `JsonHttpResponseGenerator` with a `HttpResponseSerializerInterface` provided it will automatically construct these `SerializerHttpResponse` classes for you.

Serialization is done just in time and therefore will not be represented as a performance hit within your controllers. This is done so that responses can be intercepted and changed without wasting compute on serializing data that is not needed.

### Pagination

[](#pagination)

For requests that are used in API context you may want to invoke a paginator. This package does not provide a pagination implementation but an abstraction to interact with one of your choice.

A `HttpResponseInterface` should not accept a paginator as it's data. However a `PaginatiorAwareHttpResponseInterface` will.

Because of this the following responses are available (and should be used as example for adding other types):

- `Umber\Http\Response\Type\JsonPaginatorHttpResponse`

Responses that are paginator aware should make use of the `PagiantorResponseHelper` and follow the example of the `JsonPaginatorHttpResponse`. These responses will initialise 4 new headers when the paginator is invoked.

- `Pagination-Results-Per-Page`
- `Pagination-Results-Count`
- `Pagination-Results-Total`
- `Pagination-Pages-Total`

Paginator aware responses should be automatically constructed when given to the `*Factory` of your choice. As the `*Generator` will often use the `*Factory` this class also accepts paginator's. For example giving a paginator to the `JsonHttpResponseFactory` (or `JsonHttpResponseGenerator`) will return a `JsonPaginatorHttpResponse`.

Frameworks
----------

[](#frameworks)

Currently I have a bundle for Symfony that defines all the classes as services. Controllers are allowed to return instances of `HttpResponseInterface` and they will be transformed in to Symfony `Request` objects.

Simply use the following bundle:

- `Umber\Http\Framewor\Symfony\UmberHttpBundle`

The configuration is optional, but to define a serializer implementation use the following methods to provide link to the service you wish to use.

```
umber_http:
  serializer: 'service.definition.reference.here'
```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity61

Established project with proven stability

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

Recently: every ~30 days

Total

6

Last Release

2581d ago

Major Versions

1.2.1 → 2.0.02019-04-21

### Community

Maintainers

![](https://www.gravatar.com/avatar/50611ccef7b10d4feaabd73789c52fa630cdfc9a8f7880a0cb7f393a80c2fd2f?d=identicon)[matt-usurp](/maintainers/matt-usurp)

---

Top Contributors

[![matt-usurp](https://avatars.githubusercontent.com/u/1379839?v=4)](https://github.com/matt-usurp "matt-usurp (31 commits)")

---

Tags

abstraction-layerhttpphp

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)

PHPackages © 2026

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