nuxed/http-message

Nuxed Http Message

Installs: 128

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 1

Open Issues: 0

Language:Hack

v1.2.0 2020-05-21 21:18 UTC

This package is auto-updated.

Last update: 2021-06-19 01:24:36 UTC


README

45311177?s=200&v=4

Build Status Total Downloads Latest Stable Version License

Nuxed Http Message

The Nuxed Http Message component defines an object-oriented layer for the HTTP Messages specification.

Installation

This package can be installed with Composer.

$ composer require nuxed/http-message

Example

use namespace HH\Lib\Str;
use namespace Nuxed\Http\Message;

<<__EntryPoint>>
async function main(): Awaitable<void> {
  $request = Message\ServerRequest::capture();

  $response = Message\Response\text(
    Str\format('%s %s', $request->getMethod(), $request->getRequestTarget())
  )
    |> $$->withCookie('name', new Message\Cookie('value'))
    |> $$->withStatus(200, 'OK');
}

Security

For information on reporting security vulnerabilities in Nuxed, see SECURITY.md.

License

Nuxed is open-sourced software licensed under the MIT-licensed.