mirror of
https://github.com/opus-tango/http-server-in-c.git
synced 2026-03-20 03:55:25 +00:00
add enum for request method for easy switch statements
This commit is contained in:
10
http_stuff.h
10
http_stuff.h
@@ -6,6 +6,13 @@
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
typedef enum {
|
||||
GET,
|
||||
POST,
|
||||
PUT,
|
||||
DELETE,
|
||||
} http_method;
|
||||
|
||||
/**
|
||||
* Stores a key-value pair for http headers
|
||||
*/
|
||||
@@ -18,7 +25,8 @@ struct header_kv {
|
||||
* Stores an HTTP request
|
||||
*/
|
||||
struct http_request {
|
||||
char* method;
|
||||
http_method method;
|
||||
char* method_str;
|
||||
char* url;
|
||||
int num_headers;
|
||||
struct header_kv* headers;
|
||||
|
||||
Reference in New Issue
Block a user