You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe that the community would benefit from adding a simple boolean check whether the status code of the response is acceptable.
I took inspiration from the javascript's fetch API where the response exposes response.ok to check whether the status code is >= 200 and < 300 (see the documentation), and created a simple extension to make my life easier.
I don't have any particular objection to this extension, though I'm not sure how useful it actually is: 3xx responses aren't errors, and many 2xx responses are conceptually not equivalent to ok. But the weight of fetch matters a fair bit here.
I believe that the community would benefit from adding a simple boolean check whether the status code of the response is acceptable.
I took inspiration from the javascript's
fetch
API where the response exposesresponse.ok
to check whether the status code is >= 200 and < 300 (see the documentation), and created a simple extension to make my life easier.Happy to contribute (and write tests) this if there is interest from the side of the maintainers.
The text was updated successfully, but these errors were encountered: