Work in progress demo implementation of facebookexperimental/hack-http-request-response-interfaces
This is a (currently unstable) implementation of hack-http-request-response-interfaces to allow type-safe access to http requests.
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.