add HasClient instance for HttpVersion
This commit is contained in:
parent
e5974ec94d
commit
b20b8d9770
2 changed files with 12 additions and 1 deletions
|
@ -203,6 +203,17 @@ instance (KnownSymbol sym, ToHttpApiData a, HasClient sublayout)
|
|||
|
||||
where hname = symbolVal (Proxy :: Proxy sym)
|
||||
|
||||
-- | Using a 'HttpVersion' combinator in your API doesn't affect the client
|
||||
-- functions.
|
||||
instance HasClient sublayout
|
||||
=> HasClient (HttpVersion :> sublayout) where
|
||||
|
||||
type Client (HttpVersion :> sublayout) =
|
||||
Client sublayout
|
||||
|
||||
clientWithRoute Proxy =
|
||||
clientWithRoute (Proxy :: Proxy sublayout)
|
||||
|
||||
-- | If you use a 'QueryParam' in one of your endpoints in your API,
|
||||
-- the corresponding querying function will automatically take
|
||||
-- an additional argument of the type specified by your 'QueryParam',
|
||||
|
|
|
@ -14,7 +14,7 @@ type ComprehensiveAPI =
|
|||
Get '[JSON] Int :<|>
|
||||
Capture "foo" Int :> GET :<|>
|
||||
Header "foo" Int :> GET :<|>
|
||||
-- HttpVersion :> GET :<|>
|
||||
HttpVersion :> GET :<|>
|
||||
IsSecure :> GET :<|>
|
||||
QueryParam "foo" Int :> GET :<|>
|
||||
QueryParams "foo" Int :> GET :<|>
|
||||
|
|
Loading…
Reference in a new issue