on master help sign in
Accept wider range of return codes

DELETE 201 doesn't make sense I think we can get away with just 204 without 205 and 206 GET 206 should be handled by the lib itself (?) so we only add 203 Closes #20

commitd21f0bbbfc8eb998d6e8609290272dca4f30ad55 authorMateusz Kowalczyk <fuuzetsu@fuuzetsu.co.uk> dateWed 25 Mar 2015, 15:34 (12 years ago) parentc08baab
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