#ifndef HTTP_H #define HTTP_H enum method { METHOD_GET, METHOD_HEAD, METHOD_POST, METHOD_PUT, METHOD_DELETE, METHOD_OPTIONS, METHOD_PATCH, }; struct request { enum method method; char * body; }; enum status { STATUS_OK = 200, STATUS_BAD_REQUEST = 400, STATUS_METHOD_NOT_ALLOWED = 405, STATUS_REQUEST_TIMEOUT = 408, STATUS_INTERNAL_SERVER_ERROR = 500, STATUS_NOT_IMPLEMENTED = 501, STATUS_VERSION_NOT_SUPPORTED = 505, }; extern const char * method_str[]; extern const char * status_str[]; int respond_only_status(int, enum status); int respond_with_body(int, enum status, const char *); int parse_request(int, struct request *); #endif // HTTP_H