usox / hackttp
Work in progress demo implementation of facebookexperimental/hack-http-request-response-interfaces
Installs: 23 834
Dependents: 2
Suggesters: 0
Security: 0
Stars: 8
Watchers: 4
Forks: 3
Open Issues: 4
Language:Hack
Requires
- hhvm: ^4.93
- facebook/hack-http-request-response-interfaces: ^0.3
- hhvm/hsl: ^4.25
- hhvm/hsl-experimental: ^4.58
- hhvm/hsl-io: ^0.3.0
- hhvm/type-assert: ^3.3|^4.0
- usox/hack-http-factory-interfaces: ^0.2
Requires (Dev)
- hhvm/hacktest: ^1.4|^2.0
- hhvm/hhast: ^4.1
- usox/hackmock: ^1.3
README
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.