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

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

caridea/http
============

A shrimp of an HTTP utility library

3.0.0(8y ago)08542Apache-2.0PHPPHP &gt;=7.1.0

Since Mar 22Pushed 8y ago1 watchersCompare

[ Source](https://github.com/libreworks/caridea-http)[ Packagist](https://packagist.org/packages/caridea/http)[ Docs](http://github.com/libreworks/caridea-http)[ RSS](/packages/caridea-http/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (3)Versions (10)Used By (2)

caridea-http
============

[](#caridea-http)

Caridea is a miniscule PHP application library. This shrimpy fellow is what you'd use when you just want some helping hands and not a full-blown framework.

[![](https://camo.githubusercontent.com/3a9d2bd9abd336c1541d254cd07f8dff935288ad4a0983294f0b3f572f5b0f4b/687474703a2f2f6c69627265776f726b732e636f6d2f636172696465612d3130302e706e67)](https://camo.githubusercontent.com/3a9d2bd9abd336c1541d254cd07f8dff935288ad4a0983294f0b3f572f5b0f4b/687474703a2f2f6c69627265776f726b732e636f6d2f636172696465612d3130302e706e67)

This is its HTTP component. It includes small utilities for working with [PSR-7](http://www.php-fig.org/psr/psr-7/) HTTP requests and responses, including:

- An implementation of RFC 7807, "[Problem Details for HTTP APIs](https://tools.ietf.org/html/rfc7807)".
- A utility to parse common pagination parameters from the request
- A utility to correctly parse query strings with multiple parameters having the same name
- A utility to determine a client's preferred accepted MIME type

[![Packagist](https://camo.githubusercontent.com/ceb527acca7415ff320dcd2fc1f65a298b84e5132c88484e5a2c4ea28dd38ec1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636172696465612f687474702e737667)](https://packagist.org/packages/caridea/http)[![Build Status](https://camo.githubusercontent.com/bb1e51ca076f3763bced7fa82aa94bc88aff2dc38b4a56aa4c0832b21259234c/68747470733a2f2f7472617669732d63692e6f72672f6c69627265776f726b732f636172696465612d687474702e737667)](https://travis-ci.org/libreworks/caridea-http)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/c1f6313f5b93da6609f688d1a9222c2eccaa4f1b4f518af646317473f7a8a296/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6c69627265776f726b732f636172696465612d687474702f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/libreworks/caridea-http/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/8b5f33ae7c086d3c8e30c4ccad8ab1b42e9c68e0fb380417ef4c27e07d0d94ce/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6c69627265776f726b732f636172696465612d687474702f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/libreworks/caridea-http/?branch=master)[![Documentation Status](https://camo.githubusercontent.com/8680c6c954d475e775eb34af92800cf18ab133becb2f0694d0f66120029ebfea/687474703a2f2f72656164746865646f63732e6f72672f70726f6a656374732f636172696465612d687474702f62616467652f3f76657273696f6e3d6c6174657374)](http://caridea-http.readthedocs.io/en/latest/?badge=latest)

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

[](#installation)

You can install this library using Composer:

```
$ composer require caridea/http
```

- The master branch (version 3.x) of this project requires PHP 7.1 and depends on `psr/http-message`.
- Version 2.x of this project requires PHP 7.0 and depends on `psr/http-message`.
- Version 1.x of this project requires PHP 5.5 and depends on `psr/http-message`.

Compliance
----------

[](#compliance)

Releases of this library will conform to [Semantic Versioning](http://semver.org).

Our code is intended to comply with [PSR-1](http://www.php-fig.org/psr/psr-1/), [PSR-2](http://www.php-fig.org/psr/psr-2/), and [PSR-4](http://www.php-fig.org/psr/psr-4/). If you find any issues related to standards compliance, please send a pull request!

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

[](#documentation)

- Head over to [Read the Docs](http://caridea-http.readthedocs.io/en/latest/)

Examples
--------

[](#examples)

Just a few quick examples.

### Problem Details

[](#problem-details)

We included an implementation of RFC 7807 that you can serialize to JSON or append to a PSR-7 HTTP Response.

```
use Caridea\Http\ProblemDetails;
use Zend\Diactoros\Uri;

$problem = new ProblemDetails(
    new Uri('http://example.com/problem/oops'),  // type
    'A weird thing happened',                    // title
    500,                                         // status
    'It looks like the server has goofed again', // detail
    new Uri('http://example.com/problems/1f9a'), // instance
    [                                            // extensions
        'server' => 'workerbee01.example.com',
        'auth' => 'foobar'
    ]
);
echo json_encode($problem);
```

### Pagination Factory

[](#pagination-factory)

```
use Zend\Diactoros\ServerRequestFactory;

$request = ServerRequestFactory::fromGlobals(
    $_SERVER,
    \Caridea\Http\QueryParams::getFromServer(), // instead of $_GET
);

$factory = new \Caridea\Http\PaginationFactory();

// say the Query was ?count=25&startIndex=1&sort=%2Bfoo&sort-bar
// or maybe          ?count=25&start=0&sort=%2Bfoo,-bar
// or one of many other formats for this type of pagination settingns
$pagination = $factory->create($request, 'sort');
$pagination->getMax();    // 25
$pagination->getOffset(); // 0
$pagination->getOrder();  // ['foo' => true, 'bar' => false]
```

### Accept Types

[](#accept-types)

```
// say the HTTP_ACCEPT field is text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
$types = new \Caridea\Http\AcceptTypes($_SERVER);
$types->preferred(['application/xml', 'application/json']); // returns application/xml
```

### Helper Traits

[](#helper-traits)

Two traits are now available, `JsonHelper` and `MessageHelper`. These can be used by controller classes or dispatcher middleware.

Third-Party
-----------

[](#third-party)

The traits `JsonHelper` and `MessageHelper` (as well as their unit tests) were ported to PHP from the Labrys library under a compatible Apache 2.0 license.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity64

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

Recently: every ~120 days

Total

9

Last Release

3046d ago

Major Versions

1.x-dev → 2.0.02016-03-22

2.2.x-dev → 3.0.02018-01-14

PHP version history (3 changes)1.0.0PHP &gt;=5.5.0

2.0.0PHP &gt;=7.0.0

3.0.0PHP &gt;=7.1.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/659262eac941ffe4795493834425fc9a2369c2c9df3cc565ed4194f1d37be934?d=identicon)[doublecompile](/maintainers/doublecompile)

---

Top Contributors

[![doublecompile](https://avatars.githubusercontent.com/u/4267230?v=4)](https://github.com/doublecompile "doublecompile (27 commits)")

---

Tags

httpmimeproblem detailsrfc7807rfc 7807

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

7.9k1.0B3.2k](/packages/guzzlehttp-psr7)[league/uri-interfaces

Common tools for parsing and resolving RFC3987/RFC3986 URI

536204.9M23](/packages/league-uri-interfaces)[mezzio/mezzio-problem-details

Problem Details for PSR-7 HTTP APIs addressing the RFC 7807 standard

271.1M24](/packages/mezzio-mezzio-problem-details)[zbateson/mb-wrapper

Wrapper for mbstring with fallback to iconv for encoding conversion and string manipulation

4948.6M5](/packages/zbateson-mb-wrapper)[laudis/neo4j-php-client

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

184616.9k31](/packages/laudis-neo4j-php-client)[laminas/laminas-psr7bridge

Bidirectional conversions between PSR-7 and laminas-http messages

117.9M18](/packages/laminas-laminas-psr7bridge)

PHPackages © 2026

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