on master help sign in
Accept wider range of return codes
d21f0bbMateusz Kowalczyk
src/Servant/Client.hs+2−2
@@ -111,7 +111,7 @@ instance HasClient Delete where
111 type Client Delete = BaseUrl -> EitherT ServantError IO ()
111 type Client Delete = BaseUrl -> EitherT ServantError IO ()
112
112
113 clientWithRoute Proxy req host =
113 clientWithRoute Proxy req host =
114− void $ performRequest H.methodDelete req (== 204) host
114+ void $ performRequest H.methodDelete req (`elem` [200, 202, 204]) host
115
115
116-- | If you have a 'Get' endpoint in your API, the client
116-- | If you have a 'Get' endpoint in your API, the client
117-- side querying function that is created when calling 'client'
117-- side querying function that is created when calling 'client'
@@ -120,7 +120,7 @@ instance HasClient Delete where
120instance (MimeUnrender ct result) => HasClient (Get (ct ': cts) result) where
120instance (MimeUnrender ct result) => HasClient (Get (ct ': cts) result) where
121 type Client (Get (ct ': cts) result) = BaseUrl -> EitherT ServantError IO result
121 type Client (Get (ct ': cts) result) = BaseUrl -> EitherT ServantError IO result
122 clientWithRoute Proxy req host =
122 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
124
124
125-- | If you use a 'Header' in one of your endpoints in your API,
125-- | If you use a 'Header' in one of your endpoints in your API,
126-- the corresponding querying function will automatically take
126-- the corresponding querying function will automatically take