https://github.com/usox/hackttp
PSR7-like http request/response management
https://github.com/usox/hackttp
hack hacklang hhvm http message psr7 request response
Last synced: 3 months ago
JSON representation
PSR7-like http request/response management
- Host: GitHub
- URL: https://github.com/usox/hackttp
- Owner: usox
- License: mit
- Created: 2018-02-14T21:50:40.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2021-05-20T07:11:50.000Z (over 4 years ago)
- Last Synced: 2025-01-16T05:19:34.479Z (12 months ago)
- Topics: hack, hacklang, hhvm, http, message, psr7, request, response
- Language: Hack
- Homepage:
- Size: 149 KB
- Stars: 8
- Watchers: 4
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://travis-ci.org/usox/hackttp)
# 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:
```Hack
$server_request = \Usox\HackTTP\createServerRequestFromGlobals();
```
Creating a response:
```Hack
$response = \Usox\HackTTP\createResponse(200, 'Up and at them');
```
Creating an uri:
```Hack
$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 ###