@@ -13,6 +13,7 @@
1313module Servant.Client
1414 ( client
1515 , HasClient(..)
16+ , Client
1617 , ServantError(..)
1718 , module Servant.Common.BaseUrl
1819 ) where
@@ -130,7 +131,7 @@ instance (MimeUnrender ct result) => HasClient (Get (ct ': cts) result) where
130131-- | If you have a 'Get xs ()' endpoint, the client expects a 204 No Content
131132-- HTTP header.
132133instance HasClient (Get (ct ': cts) ()) where
133− type Client (Get (ct ': cts) ()) = BaseUrl -> EitherT ServantError IO ()
134+ type Client' (Get (ct ': cts) ()) = BaseUrl -> EitherT ServantError IO ()
134135 clientWithRoute Proxy req host =
135136 performRequestNoBody H.methodGet req [204] host
136137
@@ -167,7 +168,7 @@ instance (KnownSymbol sym, ToText a, HasClient sublayout)
167168
168169 clientWithRoute Proxy req mval =
169170 clientWithRoute (Proxy :: Proxy sublayout) $
170− maybe req (\value -> addHeader hname value req) mval
171+ maybe req (\value -> Servant.Common.Req.addHeader hname value req) mval
171172
172173 where hname = symbolVal (Proxy :: Proxy sym)
173174
@@ -184,7 +185,7 @@ instance (MimeUnrender ct a) => HasClient (Post (ct ': cts) a) where
184185-- | If you have a 'Post xs ()' endpoint, the client expects a 204 No Content
185186-- HTTP header.
186187instance HasClient (Post (ct ': cts) ()) where
187− type Client (Post (ct ': cts) ()) = BaseUrl -> EitherT ServantError IO ()
188+ type Client' (Post (ct ': cts) ()) = BaseUrl -> EitherT ServantError IO ()
188189 clientWithRoute Proxy req host =
189190 void $ performRequestNoBody H.methodPost req [204] host
190191
@@ -201,7 +202,7 @@ instance (MimeUnrender ct a) => HasClient (Put (ct ': cts) a) where
201202-- | If you have a 'Put xs ()' endpoint, the client expects a 204 No Content
202203-- HTTP header.
203204instance HasClient (Put (ct ': cts) ()) where
204− type Client (Put (ct ': cts) ()) = BaseUrl -> EitherT ServantError IO ()
205+ type Client' (Put (ct ': cts) ()) = BaseUrl -> EitherT ServantError IO ()
205206 clientWithRoute Proxy req host =
206207 void $ performRequestNoBody H.methodPut req [204] host
207208
@@ -210,7 +211,7 @@ instance HasClient (Put (ct ': cts) ()) where
210211-- will just require an argument that specifies the scheme, host
211212-- and port to send the request to.
212213instance (MimeUnrender ct a) => HasClient (Patch (ct ': cts) a) where
213− type Client (Patch (ct ': cts) a) = BaseUrl -> EitherT ServantError IO a
214+ type Client' (Patch (ct ': cts) a) = BaseUrl -> EitherT ServantError IO a
214215
215216 clientWithRoute Proxy req host =
216217 performRequestCT (Proxy :: Proxy ct) H.methodPatch req [200,201] host
@@ -218,7 +219,7 @@ instance (MimeUnrender ct a) => HasClient (Patch (ct ': cts) a) where
218219-- | If you have a 'Patch xs ()' endpoint, the client expects a 204 No Content
219220-- HTTP header.
220221instance HasClient (Patch (ct ': cts) ()) where
221− type Client (Patch (ct ': cts) ()) = BaseUrl -> EitherT ServantError IO ()
222+ type Client' (Patch (ct ': cts) ()) = BaseUrl -> EitherT ServantError IO ()
222223 clientWithRoute Proxy req host =
223224 void $ performRequestNoBody H.methodPatch req [204] host
224225
@@ -489,7 +490,7 @@ instance (MimeRender ct a, HasClient sublayout)
489490 clientWithRoute Proxy req body =
490491 clientWithRoute (Proxy :: Proxy sublayout) $ do
491492 let ctProxy = Proxy :: Proxy ct
492− setRQBody (toByteString ctProxy body) (contentType ctProxy) req
493+ setRQBody (mimeRender ctProxy body) (contentType ctProxy) req
493494
494495-- | Make the querying function append @path@ to the request path.
495496instance (KnownSymbol path, HasClient sublayout) => HasClient (path :> sublayout) where