https://github.com/rzeldent/micro-http-status
Library to check the HTTP status and translate to status names
https://github.com/rzeldent/micro-http-status
http http-status http-status-code http-status-codes http-status-message http-statuscodes
Last synced: 4 months ago
JSON representation
Library to check the HTTP status and translate to status names
- Host: GitHub
- URL: https://github.com/rzeldent/micro-http-status
- Owner: rzeldent
- License: mit
- Created: 2022-10-19T18:05:47.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-12-21T08:28:41.000Z (about 2 years ago)
- Last Synced: 2025-02-03T00:31:38.809Z (about 1 year ago)
- Topics: http, http-status, http-status-code, http-status-codes, http-status-message, http-statuscodes
- Language: C++
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# micro-http-status
[](https://github.com/rzeldent/micro-http-status/actions/workflows/main.yml)
Library to check the HTTP status and translate to status names
## Introduction
This library is a helper to determine the result of http responses and to translate them to human readable string
## Checking the result
Below the list of functions provided by this library
### bool http_informational(int code)
Returns true if the response is informational (code >= 100 && code < 200)
### bool http_success(int code)
Returns true if the response is successful (code >= 200 && code < 300)
### bool http_redirection(int code)
Returns true if the response requested a redirection (code >= 300 && code < 400)
### bool http_client_error(int code)
Returns true if the response is a client error (code >= 400 && code < 500)
### bool http_server_error(int code)
Returns true if the response is a server error (code >= 500 && code < 600)
### bool http_failure(int code)
Returns true if the response indicates a client- or server error (code >= 400 && code < 600)
## Displaying the result
### const char *http_status_group(int code)
Returns the group of the response. If the group is not known, an empty string is returned
### const char *http_status_reason(int code)
Returns the status of the response. If the status is not known, an empty string is returned