hreq-core- Core functionality for Hreq Http client library

Safe HaskellNone



This module provides a HasRequest class that Interprets a ReqContent type level list into RequestF data



pattern Empty :: Hlist '[] Source #

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.

Associated Types

type HttpInput reqComponents :: Type Source #


httpReq :: Proxy verb -> Proxy reqComponents -> HttpInput reqComponents -> Request -> Request Source #

(HttpReqConstraints ts, ReflectMethod method, SingI (Req ts), SingI (Res rs), HttpResConstraints rs) => HasRequest (ts :: [ReqContent Type]) (Verb method rs) Source # 
Instance details

Defined in Hreq.Core.Client.HasRequest

Associated Types

type HttpInput ts :: Type Source #


httpReq :: Proxy (Verb method rs) -> Proxy ts -> HttpInput ts -> Request -> Request Source #

encodeHlistAsReq :: forall (ts :: [ReqContent Type]). HttpReqConstraints ts => Sing ts -> Hlist (HttpReq ts) -> Request -> Request Source #

Transform a Hlist of inputs into a RequestF

toQueryFlags :: forall (fs :: [Symbol]). All KnownSymbol fs => Sing fs -> [String] Source #