]> git.tdb.fi Git - libs/net.git/blobdiff - source/http/formdata.h
Add a class for parsing submitted form data
[libs/net.git] / source / http / formdata.h
diff --git a/source/http/formdata.h b/source/http/formdata.h
new file mode 100644 (file)
index 0000000..3232891
--- /dev/null
@@ -0,0 +1,29 @@
+#ifndef MSP_HTTP_FORMDATA_H_
+#define MSP_HTTP_FORMDATA_H_
+
+#include <map>
+#include <string>
+
+namespace Msp {
+namespace Http {
+
+class Request;
+
+class FormData
+{
+private:
+       std::map<std::string, std::string> fields;
+
+public:
+       FormData(const Request &);
+private:
+       void parse_multipart(const Request &, const std::string &);
+
+public:
+       const std::string &get_value(const std::string &) const;
+};
+
+} // namespace Http
+} // namespace Msp
+
+#endif