Module

Hyper.Response

Package
purescript-hyper
Repository
owickstrom/hyper

#StatusLineOpen Source

data StatusLineOpen

Type indicating that the status-line is ready to be sent.

#HeadersOpen Source

data HeadersOpen

Type indicating that headers are ready to be sent, i.e. the body streaming has not been started.

#BodyOpen Source

data BodyOpen

Type indicating that headers have already been sent, and that the body is currently streaming.

#ResponseEnded Source

data ResponseEnded

Type indicating that headers have already been sent, and that the body stream, and thus the response, is finished.

#ResponseStateTransition Source

type ResponseStateTransition m res from to = forall c req. Middleware m (Conn req (res from) c) (Conn req (res to) c) Unit

A middleware transitioning from one Response state to another.

#Response Source

class Response (res :: Type -> Type) m b | res -> b where

The operations that a response writer, provided by the server backend, must support.

Members

#headers Source

headers :: forall c b res req m f. Foldable f => Monad m => Response res m b => f Header -> Middleware m (Conn req (res HeadersOpen) c) (Conn req (res BodyOpen) c) Unit

#contentType Source

contentType :: forall c b res req m. Monad m => Response res m b => MediaType -> Middleware m (Conn req (res HeadersOpen) c) (Conn req (res HeadersOpen) c) Unit

#redirect Source

redirect :: forall c b res req m. Monad m => Response res m b => String -> Middleware m (Conn req (res StatusLineOpen) c) (Conn req (res HeadersOpen) c) Unit

#ResponseWritable Source

class ResponseWritable b m r  where

Members

#respond Source

respond :: forall c res req b r m. Monad m => ResponseWritable b m r => Response res m b => r -> Middleware m (Conn req (res BodyOpen) c) (Conn req (res ResponseEnded) c) Unit