Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module provides a HasRequest
class that Interprets
a ReqContent
type level list into RequestF
data
Synopsis
- pattern Empty :: Hlist '[]
- class HasRequest (reqComponents :: k) (verb :: Type) where
- getAcceptHeader :: forall (rs :: [ResContent Type]). HttpResConstraints rs => Sing rs -> Maybe MediaType
- encodeHlistAsReq :: forall (ts :: [ReqContent Type]). HttpReqConstraints ts => Sing ts -> Hlist (HttpReq ts) -> Request -> Request
- createParam :: (KnownSymbol p, ToHttpApiData a) => Sing p -> a -> QueryItem
- appendQueryFlags :: [String] -> Request -> Request
- toQueryFlags :: forall (fs :: [Symbol]). All KnownSymbol fs => Sing fs -> [String]
Documentation
class HasRequest (reqComponents :: k) (verb :: Type) where Source #
HasRequest
is used to create a Request from a ReqContent
type level list
and a Verb
.
verb
is requited for obtaining Request method and MediaType
value
reqComponents
is a usually a 'ReqContent Type' type level list.
It can be something else.
httpReq :: Proxy verb -> Proxy reqComponents -> HttpInput reqComponents -> Request -> Request Source #
Instances
(HttpReqConstraints ts, ReflectMethod method, SingI (Req ts), SingI (Res rs), HttpResConstraints rs) => HasRequest (ts :: [ReqContent Type]) (Verb method rs) Source # | |
getAcceptHeader :: forall (rs :: [ResContent Type]). HttpResConstraints rs => Sing rs -> Maybe MediaType Source #
encodeHlistAsReq :: forall (ts :: [ReqContent Type]). HttpReqConstraints ts => Sing ts -> Hlist (HttpReq ts) -> Request -> Request Source #
createParam :: (KnownSymbol p, ToHttpApiData a) => Sing p -> a -> QueryItem Source #
toQueryFlags :: forall (fs :: [Symbol]). All KnownSymbol fs => Sing fs -> [String] Source #