PHPackages                             ytake/hungrr - 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. ytake/hungrr

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

ytake/hungrr
============

HTTP Requesr and Response

0.13.3(5y ago)017.3k4MITHack

Since Nov 23Pushed 5y ago1 watchersCompare

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

READMEChangelog (10)Dependencies (9)Versions (23)Used By (4)

Hungrr / HTTP Message implementation
====================================

[](#hungrr--http-message-implementation)

[![Build Status](https://camo.githubusercontent.com/aa9caa9e2447072a602033320bfebd9628f48ee4b191da17026fd468a588a9c9/68747470733a2f2f7472617669732d63692e6f72672f7974616b652f68756e6772722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/ytake/hungrr)

`ytake/hungrr` is a Hack package containing implementations of the [Hack HTTP Request and Response Interfaces](https://github.com/hhvm/hack-http-request-response-interfaces)

PSR-7 was designed for PHP, not Hack, and some descisions do not fit smoothly with Hack's type system.

Not Supported PHP

Requirements
------------

[](#requirements)

HHVM 4.20.0 and above.

Install
-------

[](#install)

via Composer

```
$ composer install ytake/hungrr
```

Usage
-----

[](#usage)

Marshaling an incoming request
------------------------------

[](#marshaling-an-incoming-request)

```
use type Ytake\Hungrr\ServerRequestFactory;

$request = ServerRequestFactory::fromGlobals();
```

Response
--------

[](#response)

### Json Response

[](#json-response)

Constructor Detail

```
  public function __construct(
    private \HH\Lib\Experimental\IO\WriteHandle $body,
    StatusCode $status = StatusCode::OK,
    dict $headers = dict[],
    protected int $encodingOptions = self::DEFAULT_JSON_FLAGS
  )
```

Example

```
use type Ytake\Hungrr\Uri;
use type Ytake\Hungrr\StatusCode;
use type Ytake\Hungrr\Response\RedirectResponse;
use namespace HH\Lib\Experimental\IO;

list($read, $write) = IO\pipe_non_disposable();
await $write->writeAsync(\json_encode(dict[
  'testing' => dict[
    'HHVM' => 'Hack'
  ]
])));
```

### Redirect Response

[](#redirect-response)

Constructor Detail

```
public function __construct(
  mixed $uri,
  Ytake\Hungrr\StatusCode $status,
  dict $headers
)

```

$uri, MUST be a string or Facebook\\Experimental\\Http\\Message\\UriInterface instance.

Example

```
use type Ytake\Hungrr\Uri;
use type Ytake\Hungrr\StatusCode;
use type Ytake\Hungrr\Response\RedirectResponse;

// use uri string
$r = new RedirectResponse('/foo/bar');

// use uri instance
$r = new RedirectResponse(new Uri('https://example.com:10082/foo/bar'));
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community13

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

Recently: every ~16 days

Total

22

Last Release

2115d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/47817f3dd2890864096bd77ee772ec46061432f128988ca23939b0ca486d7bc3?d=identicon)[ytake](/maintainers/ytake)

---

Top Contributors

[![ytake](https://avatars.githubusercontent.com/u/4454078?v=4)](https://github.com/ytake "ytake (72 commits)")

---

Tags

hacklanghhvmhttpmessagepsr-7requestresponsehttpresponserequesthhvmhack

### Embed Badge

![Health badge](/badges/ytake-hungrr/health.svg)

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

###  Alternatives

[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

8.0k1.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)[fig/http-message-util

Utility classes and constants for use with PSR-7 (psr/http-message)

39489.0M274](/packages/fig-http-message-util)[nette/http

🌐 Nette Http: abstraction for HTTP request, response and session. Provides careful data sanitization and utility for URL and cookies manipulation.

48619.2M541](/packages/nette-http)[psr/http-server-handler

Common interface for HTTP server-side request handler

175101.3M921](/packages/psr-http-server-handler)

PHPackages © 2026

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