nero-0.3.1: Lens-based HTTP toolkit

Safe HaskellSafe
LanguageHaskell2010

Nero.Response

Contents

Synopsis

Response

ok :: Text -> Response Source

Creates an 200 OK response from the given text. It automatically encodes the text to 'utf-8'. The Mime type is text/plain.

movedPermanently :: Url -> Response Source

Creates an 301 Moved Permanently response with the Location corresponding to the given Url.

notFound :: Text -> Response Source

Creates an 404 Not Found response from the given text. It automatically encodes the text to 'utf-8'. The Mime type is text/plain.

_Ok :: Prism' Response Payload Source

A Prism' to obtain/convert a Payload from/to a 200 OK Response.

_MovedPermanently :: Prism' Response Url Source

A Prism' to obtain/convert a Payload from/to a 301 Moved Permanently Response.

_NotFound :: Prism' Response Payload Source

A Prism' to obtain/convert a Payload from/to a 404 Not Found Response.

Status

data Status Source

The HTTP status code and description.

Instances

status :: Response -> Status Source

Obtain the Status from a Response.