Class consisting of common http protocol definitions. More...
#include <http.hpp>
Classes | |
struct | content |
Content struct. More... | |
struct | version |
Version struct. More... | |
Public Types | |
enum | method_t { UNKNOWN , GET , POST , PUT , DEL , OPTIONS , HEAD } |
enum | status_t { OK = 200 , CREATED = 201 , ACCEPTED = 202 , NO_CONTENT = 204 , MULTIPLE_CHOICES = 300 , MOVED_PERMANENTLY = 301 , MOVED_TEMPORARILY = 302 , NOT_MODIFIED = 304 , BAD_REQUEST = 400 , UNAUTHORIZED = 401 , FORBIDDEN = 403 , NOT_FOUND = 404 , INTERNAL_SERVER_ERROR = 500 , NOT_IMPLEMENTED = 501 , BAD_GATEWAY = 502 , SERVICE_UNAVAILABLE = 503 } |
Static Public Member Functions | |
static OOS_HTTP_API std::string | to_string (method_t m) |
static OOS_HTTP_API matador::buffer_view | to_buffer (method_t m) |
static OOS_HTTP_API method_t | to_method (const std::string &str) |
static OOS_HTTP_API std::string | to_request_string (status_t status) |
static OOS_HTTP_API std::string | to_string (status_t status) |
static OOS_HTTP_API matador::buffer_view | to_buffer (status_t status) |
static OOS_HTTP_API status_t | to_status (const std::string &str) |
Class consisting of common http protocol definitions.
This class consists of common http protocol definitions like http method, status or a version and content struct.
There are also converting methods for these enums.
Http status codes enumeration
|
static |
Converts a given http method into a buffer_view
m | Http method to convert |
|
static |
Converts a http status enum value into a buffer_view
status | Http status enum to convert |
|
static |
Converts a given http method string into its enum representation. If the string is an unknown or unsupported http method the http method enum UNKNOWN is returned
str | String to convert |
|
static |
Converts a http status enum value into a request string i.e. "HTTP/1.1 200 OK \r\n"
status | Http status enum to convert |
|
static |
Converts a string representation of a http status into its enum value
str | String to convert |
|
static |
Converts a given http method into a string
m | Http method to convert |
|
static |
Converts a http status enum value into a string
status | Http status enum to convert |