add HasClient instance for HttpVersion

This commit is contained in:
Sönke Hahn 2016-01-16 19:34:44 +01:00
parent e5974ec94d
commit b20b8d9770
2 changed files with 12 additions and 1 deletions

View file

@ -203,6 +203,17 @@ instance (KnownSymbol sym, ToHttpApiData a, HasClient sublayout)
where hname = symbolVal (Proxy :: Proxy sym) 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, -- | If you use a 'QueryParam' in one of your endpoints in your API,
-- the corresponding querying function will automatically take -- the corresponding querying function will automatically take
-- an additional argument of the type specified by your 'QueryParam', -- an additional argument of the type specified by your 'QueryParam',

View file

@ -14,7 +14,7 @@ type ComprehensiveAPI =
Get '[JSON] Int :<|> Get '[JSON] Int :<|>
Capture "foo" Int :> GET :<|> Capture "foo" Int :> GET :<|>
Header "foo" Int :> GET :<|> Header "foo" Int :> GET :<|>
-- HttpVersion :> GET :<|> HttpVersion :> GET :<|>
IsSecure :> GET :<|> IsSecure :> GET :<|>
QueryParam "foo" Int :> GET :<|> QueryParam "foo" Int :> GET :<|>
QueryParams "foo" Int :> GET :<|> QueryParams "foo" Int :> GET :<|>