linnet-0.4.0.1: Lightweight library for building HTTP API

Safe HaskellNone
LanguageHaskell2010

Linnet.ToResponse

Synopsis

Documentation

class ToResponse ct a where Source #

Type-class to convert a value of type a into Response with Content-Type of ct

Methods

toResponse :: Status -> [Header] -> a -> Response Source #

Instances
ToResponse' (ValueT a) ct a => ToResponse ct a Source # 
Instance details

Defined in Linnet.ToResponse

Methods

toResponse :: Status -> [Header] -> a -> Response Source #

class Negotiable cts a where Source #

Type-class that enables Content-Type negotiation between client and server baked by instances of ToResponse.

Methods

negotiate :: [Quality MediaType] -> Maybe (MediaType, ToResponseF a) -> ToResponseF a Source #

Instances
Negotiable' (ContentTypeValueT cts) cts a => Negotiable cts a Source # 
Instance details

Defined in Linnet.ToResponse

Methods

negotiate :: [Quality MediaType] -> Maybe (MediaType, ToResponseF a) -> ToResponseF a Source #

data NotAcceptable406 Source #

Uninhabited type to signal the need of 406 error during Content-Type negotiation