From c4c946a83da06a0343b0ea2e4cd5a1e918578ab3 Mon Sep 17 00:00:00 2001 From: lbernstone Date: Mon, 2 Jul 2018 09:24:08 -0700 Subject: [PATCH] Broke HTTP_Method out into a separate library for reuse in ESPAsyncWebServer (#1562) --- libraries/WebServer/src/HTTP_Method.h | 15 +++++++++++++++ libraries/WebServer/src/WebServer.h | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 libraries/WebServer/src/HTTP_Method.h diff --git a/libraries/WebServer/src/HTTP_Method.h b/libraries/WebServer/src/HTTP_Method.h new file mode 100644 index 00000000..4532332b --- /dev/null +++ b/libraries/WebServer/src/HTTP_Method.h @@ -0,0 +1,15 @@ +#ifndef _HTTP_Method_H_ +#define _HTTP_Method_H_ + +typedef enum { + HTTP_GET = 0b00000001, + HTTP_POST = 0b00000010, + HTTP_DELETE = 0b00000100, + HTTP_PUT = 0b00001000, + HTTP_PATCH = 0b00010000, + HTTP_HEAD = 0b00100000, + HTTP_OPTIONS = 0b01000000, + HTTP_ANY = 0b01111111, +} HTTPMethod; + +#endif /* _HTTP_Method_H_ */ diff --git a/libraries/WebServer/src/WebServer.h b/libraries/WebServer/src/WebServer.h index f88721a0..11564c0d 100644 --- a/libraries/WebServer/src/WebServer.h +++ b/libraries/WebServer/src/WebServer.h @@ -27,8 +27,8 @@ #include #include #include +#include "HTTP_Method.h" -enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE, HTTP_OPTIONS }; enum HTTPUploadStatus { UPLOAD_FILE_START, UPLOAD_FILE_WRITE, UPLOAD_FILE_END, UPLOAD_FILE_ABORTED }; enum HTTPClientStatus { HC_NONE, HC_WAIT_READ, HC_WAIT_CLOSE };