Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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 ###