aboutsummaryrefslogtreecommitdiff
path: root/include/request.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/request.h')
-rwxr-xr-xinclude/request.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/request.h b/include/request.h
new file mode 100755
index 0000000..087b1c0
--- /dev/null
+++ b/include/request.h
@@ -0,0 +1,22 @@
+#ifndef _REQUEST_H_
+#define _REQUEST_H_
+#include "molerat.h"
+#include "url.h"
+
+enum RequestKind { GET, PUT, DEL };
+
+struct request {
+ enum RequestKind kind;
+ struct url url;
+ struct key *keys;
+};
+
+/**
+ * Convert a `struct request` to a string of chars that can be sent over the
+ * network.
+ *
+ * WARNING: Printing the screen won't work because the request ends in two
+ * \r\n's
+ */
+char *request_to_string(struct request *request);
+#endif