{"id":15789715,"url":"https://github.com/ytake/hungrr","last_synced_at":"2026-01-11T02:38:48.466Z","repository":{"id":57088279,"uuid":"156201581","full_name":"ytake/hungrr","owner":"ytake","description":"HTTP Message implementation HHVM/Hack","archived":false,"fork":false,"pushed_at":"2020-07-31T04:53:22.000Z","size":139,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-05T22:03:03.753Z","etag":null,"topics":["hacklang","hhvm","http","message","psr-7","request","response"],"latest_commit_sha":null,"homepage":"","language":"Hack","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ytake.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-05T10:43:08.000Z","updated_at":"2020-07-31T04:46:34.000Z","dependencies_parsed_at":"2022-08-20T15:31:13.499Z","dependency_job_id":null,"html_url":"https://github.com/ytake/hungrr","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ytake%2Fhungrr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ytake%2Fhungrr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ytake%2Fhungrr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ytake%2Fhungrr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ytake","download_url":"https://codeload.github.com/ytake/hungrr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246516843,"owners_count":20790304,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacklang","hhvm","http","message","psr-7","request","response"],"created_at":"2024-10-04T22:03:07.582Z","updated_at":"2026-01-11T02:38:48.460Z","avatar_url":"https://github.com/ytake.png","language":"Hack","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hungrr / HTTP Message implementation\n\n[![Build Status](https://travis-ci.org/ytake/hungrr.svg?branch=master)](https://travis-ci.org/ytake/hungrr)\n\n`ytake/hungrr` is a Hack package containing implementations of the\n[Hack HTTP Request and Response Interfaces](https://github.com/hhvm/hack-http-request-response-interfaces)\n\nPSR-7 was designed for PHP, not Hack, and some descisions do not fit smoothly with Hack's type system.\n\nNot Supported PHP\n\n## Requirements\nHHVM 4.20.0 and above.\n\n## Install\n\nvia Composer\n\n```bash\n$ composer install ytake/hungrr\n```\n\n## Usage\n\n## Marshaling an incoming request\n\n```hack\nuse type Ytake\\Hungrr\\ServerRequestFactory;\n\n$request = ServerRequestFactory::fromGlobals();\n```\n\n## Response\n\n### Json Response\n\nConstructor Detail\n\n```hack\n  public function __construct(\n    private \\HH\\Lib\\Experimental\\IO\\WriteHandle $body,\n    StatusCode $status = StatusCode::OK,\n    dict\u003cstring, vec\u003cstring\u003e\u003e $headers = dict[],\n    protected int $encodingOptions = self::DEFAULT_JSON_FLAGS\n  )\n```\n\nExample\n\n```hack\nuse type Ytake\\Hungrr\\Uri;\nuse type Ytake\\Hungrr\\StatusCode;\nuse type Ytake\\Hungrr\\Response\\RedirectResponse;\nuse namespace HH\\Lib\\Experimental\\IO;\n\nlist($read, $write) = IO\\pipe_non_disposable();\nawait $write-\u003ewriteAsync(\\json_encode(dict[\n  'testing' =\u003e dict[\n    'HHVM' =\u003e 'Hack'\n  ]\n])));\n```\n\n### Redirect Response\n\nConstructor Detail\n\n```text\npublic function __construct(\n  mixed $uri,\n  Ytake\\Hungrr\\StatusCode $status,\n  dict\u003cstring, vec\u003cstring\u003e\u003e $headers\n)\n```\n\n$uri, MUST be a string or Facebook\\Experimental\\Http\\Message\\UriInterface instance.\n\nExample\n\n```hack\nuse type Ytake\\Hungrr\\Uri;\nuse type Ytake\\Hungrr\\StatusCode;\nuse type Ytake\\Hungrr\\Response\\RedirectResponse;\n\n// use uri string\n$r = new RedirectResponse('/foo/bar');\n\n// use uri instance\n$r = new RedirectResponse(new Uri('https://example.com:10082/foo/bar'));\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fytake%2Fhungrr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fytake%2Fhungrr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fytake%2Fhungrr/lists"}