usox/hackttp

Work in progress demo implementation of facebookexperimental/hack-http-request-response-interfaces

Installs: 11 571

Dependents: 2

Suggesters: 0

Security: 0

Stars: 7

Watchers: 3

Forks: 3

Open Issues: 4

Language:Hack

v0.5.4 2021-04-12 06:06 UTC

This package is auto-updated.

Last update: 2022-01-20 08:34:51 UTC


README

Build Status

HackTTP

This is a (currently unstable) implementation of hack-http-request-response-interfaces to allow type-safe access to http requests.

Usage

Creating a server request object containing the request data:

  $server_request = \Usox\HackTTP\createServerRequestFromGlobals();

Creating a response:

  $response = \Usox\HackTTP\createResponse(200, 'Up and at them');

Creating an uri:

  $uri = \Usox\HackTTP\createUri('https://some-uri.com');

HackTTP also provides a set of factories to create the various classes. Those factories implement the hack-http-factory interfaces.

Inspired by guzzles psr7 implementation