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

http status classification #2499

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kreuzerkrieg
Copy link
Contributor

Add status_class enum for possible http code groups (classes) and a function classify_status to get code's classification. Intended for general usage to prevent code like if (http_code >= XXX && http_code < YYY)

In general all http codes are divided into 5 main categories

1xx: Informational - Request received, continuing process
2xx: Success - The action was successfully received, understood, and accepted
3xx: Redirection - Further action must be taken in order to complete the request
4xx: Client Error - The request contains bad syntax or cannot be fulfilled
5xx: Server Error - The server failed to fulfill an apparently valid request

This implementation does not take into account unassigned ranges, for more details https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml

Add `status_class` enum for possible http code groups (classes) and a function `classify_status` to get code's classification. Intended for general usage to prevent code like `if (http_code >= XXX && http_code < YYY)`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant