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

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

marcoazn89/http-wrapper
=======================

An HTTP wraper library

v2.1.1(9y ago)028.2k↓50%1MITPHPPHP &gt;=5.3.0

Since Mar 9Pushed 9y ago1 watchersCompare

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

READMEChangelog (4)Dependencies (2)Versions (5)Used By (1)

Install via Composer
--------------------

[](#install-via-composer)

```
composer require marcoazn89/http-wrapper:dev-dev

```

Features
--------

[](#features)

- PSR-7 compliant response object
- Content negotiation
- Constants to avoid mistyping
- Flexibility to use outside of PSR-7

Create a new response object
----------------------------

[](#create-a-new-response-object)

```
require '../vendor/autoload.php';

$response = new \HTTP\Response();
```

Set headers
-----------

[](#set-headers)

```
require '../vendor/autoload.php';

(new \HTTP\Response())->withType(\HTTP\Response\ContentType::JSON)
->write(['greeting' => 'Hello World'])->send();
```

Negotiate Headers
-----------------

[](#negotiate-headers)

```
require '../vendor/autoload.php';

//Assuming the client send Accept:text/plain
(new \HTTP\Response())->withTypeNegotiation()->write("Test")->send();
```

Set limits on what you can support
----------------------------------

[](#set-limits-on-what-you-can-support)

The order in which you add support matters! This will ignore any Accept headers that don't match the supported types.

```
require '../vendor/autoload.php';

use HTTP\Support\TypeSupport;
use HTTP\Response\ContentType;

// Add content you can support
TypeSupport::addSupport([
	ContentType::HTML,
	ContentType::XML
]);

// Assume the client sent XML as the accept header, the following output will be
// in XML form because it was the best match in the supported types
(new \HTTP\Response())->withTypeNegotiation()->write("Hello World")->send();
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community9

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

Total

4

Last Release

3546d ago

Major Versions

v1.0 → v2.02016-03-12

### Community

Maintainers

![](https://www.gravatar.com/avatar/0b79592619d05638f7b2d2518c3cb87b377aa6afe0a6abc1267533522ac1ddf1?d=identicon)[marcoazn89](/maintainers/marcoazn89)

---

Top Contributors

[![marcoazn89](https://avatars.githubusercontent.com/u/5152559?v=4)](https://github.com/marcoazn89 "marcoazn89 (61 commits)")

---

Tags

httpphplibrary

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[openswoole/core

Openswoole core library

181.1M32](/packages/openswoole-core)

PHPackages © 2026

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