Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Status code as string #88

Closed
ivan-kleshnin opened this issue Jul 16, 2015 · 2 comments
Closed

Status code as string #88

ivan-kleshnin opened this issue Jul 16, 2015 · 2 comments

Comments

@ivan-kleshnin
Copy link

Of course it's trivial to convert between Number and String but maybe String is a better default as
statusCode.startsWith("2") / statusCode.startsWith("4") type of operations seems
to naturally follow the response.

@mzabriskie
Copy link
Member

I think it makes more sense to use numbers so that you can do stuff like statusCode > 200. Long term it may be doing something like #41 where any request made to the server that receives a response will be treated as success. Only errors that can't reach the server will be treated as an error. It would be much more necessary in this case to allow something like statusCode >= 200 && statusCode < 300.

Should be easy enough to just do String(statusCode).startsWith('2').

@ivan-kleshnin
Copy link
Author

Ah, maybe you're right.

@axios axios locked and limited conversation to collaborators May 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants