Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 19 days 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 7 years ago)
- Default Branch: master
- Last Pushed: 2021-05-20T07:11:50.000Z (over 3 years ago)
- Last Synced: 2024-09-19T03:15:12.017Z (about 2 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
[![Build Status](https://travis-ci.org/usox/hackttp.svg?branch=master)](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 ###