@@ -36,6 +36,8 @@ import Network.HTTP.Media
36import qualified Network.HTTP.Types as H
36import qualified Network.HTTP.Types as H
37import qualified Network.HTTP.Types.Header as HTTP
37import qualified Network.HTTP.Types.Header as HTTP
38import Servant.API
38import Servant.API
39+import Servant.API.ResponseHeaders
40+import Servant.API.ContentTypes
39import Servant.Common.BaseUrl
41import Servant.Common.BaseUrl
40import Servant.Common.Req
42import Servant.Common.Req
@@ -62,6 +64,7 @@ class HasClient layout where
62 type Client layout :: *
64 type Client layout :: *
63 clientWithRoute :: Proxy layout -> Req -> Client layout
65 clientWithRoute :: Proxy layout -> Req -> Client layout
67+type Client layout = Client' layout
66-- | A client querying function for @a ':<|>' b@ will actually hand you
69-- | A client querying function for @a ':<|>' b@ will actually hand you
67-- one function for querying @a@ and another one for querying @b@,
70-- one function for querying @a@ and another one for querying @b@,
@@ -107,9 +110,10 @@ instance (KnownSymbol capture, ToText a, HasClient sublayout)
107 type Client (Capture capture a :> sublayout) =
110 type Client (Capture capture a :> sublayout) =
108 a -> Client sublayout
111 a -> Client sublayout
110− clientWithRoute Proxy req val =
113+ clientWithRoute Proxy req baseurl val =
111− clientWithRoute (Proxy :: Proxy sublayout) $
114+ clientWithRoute (Proxy :: Proxy sublayout)
112− appendToPath p req
115+ (appendToPath p req)
114 where p = unpack (toText val)
118 where p = unpack (toText val)
@@ -122,9 +126,9 @@ instance
122 {-# OVERLAPPABLE #-}
126 {-# OVERLAPPABLE #-}
124 (MimeUnrender ct a) => HasClient (Delete (ct ': cts) a) where
128 (MimeUnrender ct a) => HasClient (Delete (ct ': cts) a) where
125− type Client (Delete (ct ': cts) a) = BaseUrl -> EitherT ServantError IO a
129+ type Client (Delete (ct ': cts) a) = EitherT ServantError IO a
126− clientWithRoute Proxy req host =
130+ clientWithRoute Proxy req baseurl =
127− snd <$> performRequestCT (Proxy :: Proxy ct) H.methodDelete req [200, 202] host
131+ snd <$> performRequestCT (Proxy :: Proxy ct) H.methodDelete req [200, 202] baseurl
129-- | If you have a 'Delete xs ()' endpoint, the client expects a 204 No Content
133-- | If you have a 'Delete xs ()' endpoint, the client expects a 204 No Content
130-- HTTP header.
134-- HTTP header.
@@ -133,9 +137,9 @@ instance
133 {-# OVERLAPPING #-}
137 {-# OVERLAPPING #-}
135 HasClient (Delete (ct ': cts) ()) where
139 HasClient (Delete (ct ': cts) ()) where
136− type Client (Delete (ct ': cts) ()) = BaseUrl -> EitherT ServantError IO ()
140+ type Client (Delete (ct ': cts) ()) = EitherT ServantError IO ()
137− clientWithRoute Proxy req host =
141+ clientWithRoute Proxy req baseurl =
138− void $ performRequestNoBody H.methodDelete req [204] host
142+ void $ performRequestNoBody H.methodDelete req [204] baseurl
140-- | If you have a 'Delete xs (Headers ls x)' endpoint, the client expects the
144-- | If you have a 'Delete xs (Headers ls x)' endpoint, the client expects the
141-- corresponding headers.
145-- corresponding headers.
@@ -145,14 +149,13 @@ instance
146 ( MimeUnrender ct a, BuildHeadersTo ls
150 ( MimeUnrender ct a, BuildHeadersTo ls
147 ) => HasClient (Delete (ct ': cts) (Headers ls a)) where
151 ) => HasClient (Delete (ct ': cts) (Headers ls a)) where
148− type Client (Delete (ct ': cts) (Headers ls a)) = BaseUrl -> EitherT ServantError IO (Headers ls a)
152+ type Client (Delete (ct ': cts) (Headers ls a)) = EitherT ServantError IO (Headers ls a)
149− clientWithRoute Proxy req host = do
153+ clientWithRoute Proxy req baseurl = do
150− (hdrs, resp) <- performRequestCT (Proxy :: Proxy ct) H.methodDelete req [200, 202] host
154+ (hdrs, resp) <- performRequestCT (Proxy :: Proxy ct) H.methodDelete req [200, 202] baseurl
151 return $ Headers { getResponse = resp
155 return $ Headers { getResponse = resp
152 , getHeadersHList = buildHeadersTo hdrs
156 , getHeadersHList = buildHeadersTo hdrs
156-- | If you have a 'Get' endpoint in your API, the client
159-- | If you have a 'Get' endpoint in your API, the client
157-- side querying function that is created when calling 'client'
160-- side querying function that is created when calling 'client'
158-- will just require an argument that specifies the scheme, host
161-- will just require an argument that specifies the scheme, host
@@ -162,9 +165,9 @@ instance
162 {-# OVERLAPPABLE #-}
165 {-# OVERLAPPABLE #-}
164 (MimeUnrender ct result) => HasClient (Get (ct ': cts) result) where
167 (MimeUnrender ct result) => HasClient (Get (ct ': cts) result) where
165− type Client (Get (ct ': cts) result) = BaseUrl -> EitherT ServantError IO result
168+ type Client (Get (ct ': cts) result) = EitherT ServantError IO result
166− clientWithRoute Proxy req host =
169+ clientWithRoute Proxy req baseurl =
167− snd <$> performRequestCT (Proxy :: Proxy ct) H.methodGet req [200, 203] host
170+ snd <$> performRequestCT (Proxy :: Proxy ct) H.methodGet req [200, 203] baseurl
169-- | If you have a 'Get xs ()' endpoint, the client expects a 204 No Content
172-- | If you have a 'Get xs ()' endpoint, the client expects a 204 No Content
170-- HTTP status.
173-- HTTP status.
@@ -173,9 +176,9 @@ instance
173 {-# OVERLAPPING #-}
176 {-# OVERLAPPING #-}
175 HasClient (Get (ct ': cts) ()) where
178 HasClient (Get (ct ': cts) ()) where
176− type Client (Get (ct ': cts) ()) = BaseUrl -> EitherT ServantError IO ()
179+ type Client (Get (ct ': cts) ()) = EitherT ServantError IO ()
177− clientWithRoute Proxy req host =
180+ clientWithRoute Proxy req baseurl =
178− performRequestNoBody H.methodGet req [204] host
181+ performRequestNoBody H.methodGet req [204] baseurl
180-- | If you have a 'Get xs (Headers ls x)' endpoint, the client expects the
183-- | If you have a 'Get xs (Headers ls x)' endpoint, the client expects the
181-- corresponding headers.
184-- corresponding headers.
@@ -185,9 +188,9 @@ instance
186 ( MimeUnrender ct a, BuildHeadersTo ls
189 ( MimeUnrender ct a, BuildHeadersTo ls
187 ) => HasClient (Get (ct ': cts) (Headers ls a)) where
190 ) => HasClient (Get (ct ': cts) (Headers ls a)) where
188− type Client (Get (ct ': cts) (Headers ls a)) = BaseUrl -> EitherT ServantError IO (Headers ls a)
191+ type Client (Get (ct ': cts) (Headers ls a)) = EitherT ServantError IO (Headers ls a)
189− clientWithRoute Proxy req host = do
192+ clientWithRoute Proxy req baseurl = do
190− (hdrs, resp) <- performRequestCT (Proxy :: Proxy ct) H.methodGet req [200, 203, 204] host
193+ (hdrs, resp) <- performRequestCT (Proxy :: Proxy ct) H.methodGet req [200, 203, 204] baseurl
191 return $ Headers { getResponse = resp
194 return $ Headers { getResponse = resp
192 , getHeadersHList = buildHeadersTo hdrs
195 , getHeadersHList = buildHeadersTo hdrs
@@ -223,9 +226,13 @@ instance (KnownSymbol sym, ToText a, HasClient sublayout)
223 type Client (Header sym a :> sublayout) =
226 type Client (Header sym a :> sublayout) =
224 Maybe a -> Client sublayout
227 Maybe a -> Client sublayout
226− clientWithRoute Proxy req mval =
229+ clientWithRoute Proxy req baseurl mval =
227− clientWithRoute (Proxy :: Proxy sublayout) $
230+ clientWithRoute (Proxy :: Proxy sublayout)
228− maybe req (\value -> Servant.Common.Req.addHeader hname value req) mval
232+ (\value -> Servant.Common.Req.addHeader hname value req)
230 where hname = symbolVal (Proxy :: Proxy sym)
237 where hname = symbolVal (Proxy :: Proxy sym)
@@ -238,10 +245,9 @@ instance
238 {-# OVERLAPPABLE #-}
245 {-# OVERLAPPABLE #-}
240 (MimeUnrender ct a) => HasClient (Post (ct ': cts) a) where
247 (MimeUnrender ct a) => HasClient (Post (ct ': cts) a) where
241− type Client (Post (ct ': cts) a) = BaseUrl -> EitherT ServantError IO a
248+ type Client (Post (ct ': cts) a) = EitherT ServantError IO a
243− clientWithRoute Proxy req uri =
249+ clientWithRoute Proxy req baseurl =
244− snd <$> performRequestCT (Proxy :: Proxy ct) H.methodPost req [200,201] uri
250+ snd <$> performRequestCT (Proxy :: Proxy ct) H.methodPost req [200,201] baseurl
246-- | If you have a 'Post xs ()' endpoint, the client expects a 204 No Content
252-- | If you have a 'Post xs ()' endpoint, the client expects a 204 No Content
247-- HTTP header.
253-- HTTP header.
@@ -250,9 +256,9 @@ instance
250 {-# OVERLAPPING #-}
256 {-# OVERLAPPING #-}
252 HasClient (Post (ct ': cts) ()) where
258 HasClient (Post (ct ': cts) ()) where
253− type Client (Post (ct ': cts) ()) = BaseUrl -> EitherT ServantError IO ()
259+ type Client (Post (ct ': cts) ()) = EitherT ServantError IO ()
254− clientWithRoute Proxy req host =
260+ clientWithRoute Proxy req baseurl =
255− void $ performRequestNoBody H.methodPost req [204] host
261+ void $ performRequestNoBody H.methodPost req [204] baseurl
257-- | If you have a 'Post xs (Headers ls x)' endpoint, the client expects the
263-- | If you have a 'Post xs (Headers ls x)' endpoint, the client expects the
258-- corresponding headers.
264-- corresponding headers.
@@ -262,9 +268,9 @@ instance
263 ( MimeUnrender ct a, BuildHeadersTo ls
269 ( MimeUnrender ct a, BuildHeadersTo ls
264 ) => HasClient (Post (ct ': cts) (Headers ls a)) where
270 ) => HasClient (Post (ct ': cts) (Headers ls a)) where
265− type Client (Post (ct ': cts) (Headers ls a)) = BaseUrl -> EitherT ServantError IO (Headers ls a)
271+ type Client (Post (ct ': cts) (Headers ls a)) = EitherT ServantError IO (Headers ls a)
266− clientWithRoute Proxy req host = do
272+ clientWithRoute Proxy req baseurl = do
267− (hdrs, resp) <- performRequestCT (Proxy :: Proxy ct) H.methodPost req [200, 201] host
273+ (hdrs, resp) <- performRequestCT (Proxy :: Proxy ct) H.methodPost req [200, 201] baseurl
268 return $ Headers { getResponse = resp
274 return $ Headers { getResponse = resp
269 , getHeadersHList = buildHeadersTo hdrs
275 , getHeadersHList = buildHeadersTo hdrs
@@ -278,10 +284,9 @@ instance
278 {-# OVERLAPPABLE #-}
284 {-# OVERLAPPABLE #-}
280 (MimeUnrender ct a) => HasClient (Put (ct ': cts) a) where
286 (MimeUnrender ct a) => HasClient (Put (ct ': cts) a) where
281− type Client (Put (ct ': cts) a) = BaseUrl -> EitherT ServantError IO a
287+ type Client (Put (ct ': cts) a) = EitherT ServantError IO a
283− clientWithRoute Proxy req host =
288+ clientWithRoute Proxy req baseurl =
284− snd <$> performRequestCT (Proxy :: Proxy ct) H.methodPut req [200,201] host
289+ snd <$> performRequestCT (Proxy :: Proxy ct) H.methodPut req [200,201] baseurl
286-- | If you have a 'Put xs ()' endpoint, the client expects a 204 No Content
291-- | If you have a 'Put xs ()' endpoint, the client expects a 204 No Content
287-- HTTP header.
292-- HTTP header.
@@ -290,9 +295,9 @@ instance
290 {-# OVERLAPPING #-}
295 {-# OVERLAPPING #-}
292 HasClient (Put (ct ': cts) ()) where
297 HasClient (Put (ct ': cts) ()) where
293− type Client (Put (ct ': cts) ()) = BaseUrl -> EitherT ServantError IO ()
298+ type Client (Put (ct ': cts) ()) = EitherT ServantError IO ()
294− clientWithRoute Proxy req host =
299+ clientWithRoute Proxy req baseurl =
295− void $ performRequestNoBody H.methodPut req [204] host
300+ void $ performRequestNoBody H.methodPut req [204] baseurl
297-- | If you have a 'Put xs (Headers ls x)' endpoint, the client expects the
302-- | If you have a 'Put xs (Headers ls x)' endpoint, the client expects the
298-- corresponding headers.
303-- corresponding headers.
@@ -302,9 +307,9 @@ instance
303 ( MimeUnrender ct a, BuildHeadersTo ls
308 ( MimeUnrender ct a, BuildHeadersTo ls
304 ) => HasClient (Put (ct ': cts) (Headers ls a)) where
309 ) => HasClient (Put (ct ': cts) (Headers ls a)) where
305− type Client (Put (ct ': cts) (Headers ls a)) = BaseUrl -> EitherT ServantError IO (Headers ls a)
310+ type Client (Put (ct ': cts) (Headers ls a)) = EitherT ServantError IO (Headers ls a)
306− clientWithRoute Proxy req host = do
311+ clientWithRoute Proxy req baseurl = do
307− (hdrs, resp) <- performRequestCT (Proxy :: Proxy ct) H.methodPut req [200, 201] host
312+ (hdrs, resp) <- performRequestCT (Proxy :: Proxy ct) H.methodPut req [200, 201] baseurl
308 return $ Headers { getResponse = resp
313 return $ Headers { getResponse = resp
309 , getHeadersHList = buildHeadersTo hdrs
314 , getHeadersHList = buildHeadersTo hdrs
@@ -318,10 +323,9 @@ instance
318 {-# OVERLAPPABLE #-}
323 {-# OVERLAPPABLE #-}
320 (MimeUnrender ct a) => HasClient (Patch (ct ': cts) a) where
325 (MimeUnrender ct a) => HasClient (Patch (ct ': cts) a) where
321− type Client (Patch (ct ': cts) a) = BaseUrl -> EitherT ServantError IO a
326+ type Client (Patch (ct ': cts) a) = EitherT ServantError IO a
323− clientWithRoute Proxy req host =
327+ clientWithRoute Proxy req baseurl =
324− snd <$> performRequestCT (Proxy :: Proxy ct) H.methodPatch req [200,201] host
328+ snd <$> performRequestCT (Proxy :: Proxy ct) H.methodPatch req [200,201] baseurl
326-- | If you have a 'Patch xs ()' endpoint, the client expects a 204 No Content
330-- | If you have a 'Patch xs ()' endpoint, the client expects a 204 No Content
327-- HTTP header.
331-- HTTP header.
@@ -330,9 +334,9 @@ instance
330 {-# OVERLAPPING #-}
334 {-# OVERLAPPING #-}
332 HasClient (Patch (ct ': cts) ()) where
336 HasClient (Patch (ct ': cts) ()) where
333− type Client (Patch (ct ': cts) ()) = BaseUrl -> EitherT ServantError IO ()
337+ type Client (Patch (ct ': cts) ()) = EitherT ServantError IO ()
334− clientWithRoute Proxy req host =
338+ clientWithRoute Proxy req baseurl =
335− void $ performRequestNoBody H.methodPatch req [204] host
339+ void $ performRequestNoBody H.methodPatch req [204] baseurl
337-- | If you have a 'Patch xs (Headers ls x)' endpoint, the client expects the
341-- | If you have a 'Patch xs (Headers ls x)' endpoint, the client expects the
338-- corresponding headers.
342-- corresponding headers.
@@ -342,9 +346,9 @@ instance
343 ( MimeUnrender ct a, BuildHeadersTo ls
347 ( MimeUnrender ct a, BuildHeadersTo ls
344 ) => HasClient (Patch (ct ': cts) (Headers ls a)) where
348 ) => HasClient (Patch (ct ': cts) (Headers ls a)) where
345− type Client (Patch (ct ': cts) (Headers ls a)) = BaseUrl -> EitherT ServantError IO (Headers ls a)
349+ type Client (Patch (ct ': cts) (Headers ls a)) = EitherT ServantError IO (Headers ls a)
346− clientWithRoute Proxy req host = do
350+ clientWithRoute Proxy req baseurl = do
347− (hdrs, resp) <- performRequestCT (Proxy :: Proxy ct) H.methodPatch req [200, 201, 204] host
351+ (hdrs, resp) <- performRequestCT (Proxy :: Proxy ct) H.methodPatch req [200, 201, 204] baseurl
348 return $ Headers { getResponse = resp
352 return $ Headers { getResponse = resp
349 , getHeadersHList = buildHeadersTo hdrs
353 , getHeadersHList = buildHeadersTo hdrs
@@ -381,9 +385,13 @@ instance (KnownSymbol sym, ToText a, HasClient sublayout)
381 Maybe a -> Client sublayout
385 Maybe a -> Client sublayout
383 -- if mparam = Nothing, we don't add it to the query string
387 -- if mparam = Nothing, we don't add it to the query string
384− clientWithRoute Proxy req mparam =
388+ clientWithRoute Proxy req baseurl mparam =
385− clientWithRoute (Proxy :: Proxy sublayout) $
389+ clientWithRoute (Proxy :: Proxy sublayout)
386− maybe req (flip (appendToQueryString pname) req . Just) mparamText
391+ (flip (appendToQueryString pname) req . Just)
388 where pname = cs pname'
396 where pname = cs pname'
389 pname' = symbolVal (Proxy :: Proxy sym)
397 pname' = symbolVal (Proxy :: Proxy sym)
@@ -422,9 +430,13 @@ instance (KnownSymbol sym, ToText a, HasClient sublayout)
422 type Client (QueryParams sym a :> sublayout) =
430 type Client (QueryParams sym a :> sublayout) =
423 [a] -> Client sublayout
431 [a] -> Client sublayout
425− clientWithRoute Proxy req paramlist =
433+ clientWithRoute Proxy req baseurl paramlist =
426− clientWithRoute (Proxy :: Proxy sublayout) $
434+ clientWithRoute (Proxy :: Proxy sublayout)
427− foldl' (\ req' -> maybe req' (flip (appendToQueryString pname) req' . Just)) req paramlist'
435+ (foldl' (\ req' -> maybe req' (flip (appendToQueryString pname) req' . Just))
429 where pname = cs pname'
441 where pname = cs pname'
430 pname' = symbolVal (Proxy :: Proxy sym)
442 pname' = symbolVal (Proxy :: Proxy sym)
@@ -457,11 +469,13 @@ instance (KnownSymbol sym, HasClient sublayout)
457 type Client (QueryFlag sym :> sublayout) =
469 type Client (QueryFlag sym :> sublayout) =
458 Bool -> Client sublayout
470 Bool -> Client sublayout
460− clientWithRoute Proxy req flag =
472+ clientWithRoute Proxy req baseurl flag =
461− clientWithRoute (Proxy :: Proxy sublayout) $
473+ clientWithRoute (Proxy :: Proxy sublayout)
462− if flag
474+ (if flag
463− then appendToQueryString paramname Nothing req
475+ then appendToQueryString paramname Nothing req
464− else req
476+ else req
466 where paramname = cs $ symbolVal (Proxy :: Proxy sym)
480 where paramname = cs $ symbolVal (Proxy :: Proxy sym)
@@ -497,9 +511,13 @@ instance (KnownSymbol sym, ToText a, HasClient sublayout)
497 Maybe a -> Client sublayout
511 Maybe a -> Client sublayout
499 -- if mparam = Nothing, we don't add it to the query string
513 -- if mparam = Nothing, we don't add it to the query string
500− clientWithRoute Proxy req mparam =
514+ clientWithRoute Proxy req baseurl mparam =
501− clientWithRoute (Proxy :: Proxy sublayout) $
515+ clientWithRoute (Proxy :: Proxy sublayout)
502− maybe req (flip (appendToMatrixParams pname . Just) req) mparamText
517+ (flip (appendToMatrixParams pname . Just) req)
504 where pname = symbolVal (Proxy :: Proxy sym)
522 where pname = symbolVal (Proxy :: Proxy sym)
505 mparamText = fmap (cs . toText) mparam
523 mparamText = fmap (cs . toText) mparam
@@ -537,9 +555,13 @@ instance (KnownSymbol sym, ToText a, HasClient sublayout)
537 type Client (MatrixParams sym a :> sublayout) =
555 type Client (MatrixParams sym a :> sublayout) =
538 [a] -> Client sublayout
556 [a] -> Client sublayout
540− clientWithRoute Proxy req paramlist =
558+ clientWithRoute Proxy req baseurl paramlist =
541− clientWithRoute (Proxy :: Proxy sublayout) $
559+ clientWithRoute (Proxy :: Proxy sublayout)
542− foldl' (\ req' value -> maybe req' (flip (appendToMatrixParams pname) req' . Just . cs) value) req paramlist'
560+ (foldl' (\ req' value -> maybe req' (flip (appendToMatrixParams pname) req' . Just . cs) value)
544 where pname = cs pname'
566 where pname = cs pname'
545 pname' = symbolVal (Proxy :: Proxy sym)
567 pname' = symbolVal (Proxy :: Proxy sym)
@@ -572,22 +594,24 @@ instance (KnownSymbol sym, HasClient sublayout)
572 type Client (MatrixFlag sym :> sublayout) =
594 type Client (MatrixFlag sym :> sublayout) =
573 Bool -> Client sublayout
595 Bool -> Client sublayout
575− clientWithRoute Proxy req flag =
597+ clientWithRoute Proxy req baseurl flag =
576− clientWithRoute (Proxy :: Proxy sublayout) $
598+ clientWithRoute (Proxy :: Proxy sublayout)
577− if flag
599+ (if flag
578− then appendToMatrixParams paramname Nothing req
600+ then appendToMatrixParams paramname Nothing req
579− else req
601+ else req
581 where paramname = cs $ symbolVal (Proxy :: Proxy sym)
605 where paramname = cs $ symbolVal (Proxy :: Proxy sym)
583-- | Pick a 'Method' and specify where the server you want to query is. You get
607-- | Pick a 'Method' and specify where the server you want to query is. You get
584-- back the full `Response`.
608-- back the full `Response`.
585instance HasClient Raw where
609instance HasClient Raw where
586− type Client Raw = H.Method -> BaseUrl -> EitherT ServantError IO (Int, ByteString, MediaType, [HTTP.Header], Response ByteString)
610+ type Client Raw = H.Method -> EitherT ServantError IO (Int, ByteString, MediaType, [HTTP.Header], Response ByteString)
588 clientWithRoute :: Proxy Raw -> Req -> Client Raw
612 clientWithRoute :: Proxy Raw -> Req -> Client Raw
589− clientWithRoute Proxy req httpMethod host = do
613+ clientWithRoute Proxy req httpMethod baseurl = do
590− performRequest httpMethod req (const True) host
614+ performRequest httpMethod req (const True) baseurl
592-- | If you use a 'ReqBody' in one of your endpoints in your API,
616-- | If you use a 'ReqBody' in one of your endpoints in your API,
593-- the corresponding querying function will automatically take
617-- the corresponding querying function will automatically take
@@ -613,18 +637,23 @@ instance (MimeRender ct a, HasClient sublayout)
613 type Client (ReqBody (ct ': cts) a :> sublayout) =
637 type Client (ReqBody (ct ': cts) a :> sublayout) =
614 a -> Client sublayout
638 a -> Client sublayout
616− clientWithRoute Proxy req body =
640+ clientWithRoute Proxy req baseurl body =
617− clientWithRoute (Proxy :: Proxy sublayout) $ do
641+ clientWithRoute (Proxy :: Proxy sublayout)
618− let ctProxy = Proxy :: Proxy ct
642+ (let ctProxy = Proxy :: Proxy ct
619− setRQBody (mimeRender ctProxy body) (contentType ctProxy) req
643+ in setRQBody (mimeRender ctProxy body)
644+ (contentType ctProxy)
621-- | Make the querying function append @path@ to the request path.
649-- | Make the querying function append @path@ to the request path.
622instance (KnownSymbol path, HasClient sublayout) => HasClient (path :> sublayout) where
650instance (KnownSymbol path, HasClient sublayout) => HasClient (path :> sublayout) where
623 type Client (path :> sublayout) = Client sublayout
651 type Client (path :> sublayout) = Client sublayout
625− clientWithRoute Proxy req =
653+ clientWithRoute Proxy req baseurl =
626− clientWithRoute (Proxy :: Proxy sublayout) $
654+ clientWithRoute (Proxy :: Proxy sublayout)
627− appendToPath p req
655+ (appendToPath p req)
629 where p = symbolVal (Proxy :: Proxy path)
658 where p = symbolVal (Proxy :: Proxy path)