hreq-core-0.1.0.0: Core functionality for Hreq Http client library

Safe HaskellNone
LanguageHaskell2010

Hreq.Core.Client.HasRequest

Description

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

Synopsis

Documentation

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 #

Methods

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 # 
Instance details

Defined in Hreq.Core.Client.HasRequest

Associated Types

type HttpInput ts :: Type Source #

Methods

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 #