Safe Haskell | None |
---|---|
Language | Haskell2010 |
Documentation
type Header = Header' '[Optional, Strict] Source #
Extract the given header's value as a value of type a
.
I.e. header sent by client, parsed by server.
Example:
>>>
newtype Referer = Referer Text deriving (Eq, Show)
>>>
>>>
-- GET /view-my-referer
>>>
type MyApi = "view-my-referer" :> Header "from" Referer :> Get '[JSON] Referer
data Header' (mods :: [*]) (sym :: Symbol) a Source #
Instances
(KnownSymbol h, ToHttpApiData v) => AddHeader h v (Headers (fst ': rest) a) (Headers (Header h v ': (fst ': rest)) a) Source # | |
Defined in Servant.API.ResponseHeaders addOptionalHeader :: ResponseHeader h v -> Headers (fst ': rest) a -> Headers (Header h v ': (fst ': rest)) a | |
HasLink sub => HasLink (Header' mods sym a :> sub :: *) Source # | |
(FromHttpApiData v, BuildHeadersTo xs, KnownSymbol h) => BuildHeadersTo (Header h v ': xs) Source # | |
Defined in Servant.API.ResponseHeaders | |
type MkLink (Header' mods sym a :> sub :: *) r Source # | |