summaryrefslogtreecommitdiffhomepage
path: root/http.h
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2020-05-01 15:43:07 +0200
committerAki <please@ignore.pl>2020-05-01 16:42:19 +0200
commit922bb99578b881065048102e03c73ff91c5ad30a (patch)
treed2033cf94f7330c194e53f91d8d4bf40d34370ca /http.h
parent03360ae6aa07289eac060870972d4ba246ca88d3 (diff)
downloadplop-922bb99578b881065048102e03c73ff91c5ad30a.zip
plop-922bb99578b881065048102e03c73ff91c5ad30a.tar.gz
plop-922bb99578b881065048102e03c73ff91c5ad30a.tar.bz2
Moved out http-related functionality out of main file
Diffstat (limited to 'http.h')
-rw-r--r--http.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/http.h b/http.h
new file mode 100644
index 0000000..cef3048
--- /dev/null
+++ b/http.h
@@ -0,0 +1,30 @@
+enum method
+{
+ METHOD_GET,
+ METHOD_HEAD,
+ METHOD_POST,
+ METHOD_PUT,
+ METHOD_DELETE,
+ METHOD_OPTIONS,
+ METHOD_PATCH,
+};
+
+struct request
+{
+ enum method method;
+};
+
+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 * status_str[];
+
+int respond_only_status(int, enum status);