on master help sign in
Merge pull request #22 from Fuuzetsu/accepted-codes

Accept wider range of return codes

commitac733be7f2f12f8fcc6cc3770d9cc79e2d98dd84 authorJulian Arni <jkarni@gmail.com> dateWed 25 Mar 2015, 18:50 (12 years ago) parent685eec0d21f0bb
1 file changed+2−2
src/Servant/Client.hs+2−2
src/Servant/Client.hs+2−2
@@ -111,7 +111,7 @@ instance HasClient Delete where
111111 type Client Delete = BaseUrl -> EitherT ServantError IO ()
112112
113113 clientWithRoute Proxy req host =
114− void $ performRequest H.methodDelete req (== 204) host
114+ void $ performRequest H.methodDelete req (`elem` [200, 202, 204]) host
115115
116116-- | If you have a 'Get' endpoint in your API, the client
117117-- side querying function that is created when calling 'client'
@@ -120,7 +120,7 @@ instance HasClient Delete where
120120instance (MimeUnrender ct result) => HasClient (Get (ct ': cts) result) where
121121 type Client (Get (ct ': cts) result) = BaseUrl -> EitherT ServantError IO result
122122 clientWithRoute Proxy req host =
123− performRequestCT (Proxy :: Proxy ct) H.methodGet req [200] host
123+ performRequestCT (Proxy :: Proxy ct) H.methodGet req [200, 203] host
124124
125125-- | If you use a 'Header' in one of your endpoints in your API,
126126-- the corresponding querying function will automatically take