From be4083106b245053992e2b15c4c75aa74f5d39de Mon Sep 17 00:00:00 2001 From: Adam Date: Sun, 30 Oct 2016 18:58:11 -0400 Subject: Add new RESTful JSON API and documentation --- include/modules/httpd.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'include/modules') diff --git a/include/modules/httpd.h b/include/modules/httpd.h index ce28e0622..9cbef9b78 100644 --- a/include/modules/httpd.h +++ b/include/modules/httpd.h @@ -22,12 +22,31 @@ enum HTTPError { HTTP_ERROR_OK = 200, + HTTP_CREATED = 201, HTTP_FOUND = 302, HTTP_BAD_REQUEST = 400, HTTP_PAGE_NOT_FOUND = 404, + HTTP_INTERNAL_SERVER_ERROR = 500, HTTP_NOT_SUPPORTED = 505 }; +namespace httpd +{ + +enum class Method +{ + NONE, + GET, + POST, + PUT, + DELETE, + OPTIONS, + HEAD +}; + +} // namespace httpd + + /* A message to someone */ struct HTTPReply { @@ -93,6 +112,7 @@ struct HTTPReply /* A message from soneone */ struct HTTPMessage { + httpd::Method method = httpd::Method::NONE; std::map headers; std::map cookies; std::map get_data; -- cgit