HTTPServer

Dependents:   HTTPServerCustom

Fork of HTTPServer by Donatien Garnier

Files at this revision

API Documentation at this revision

Comitter:
wellmon7
Date:
Mon Sep 29 23:43:30 2014 +0000
Parent:
6:d753966e4d97
Commit message:
Made Mbed a server

Changed in this revision

LPC1768/services/http/server/impl/PostHandler.h Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/LPC1768/services/http/server/impl/PostHandler.h	Mon Sep 29 23:43:30 2014 +0000
@@ -0,0 +1,38 @@
+#ifndef POST_HANDLER_H
+#define POST_HANDLER_H
+#include "../HTTPRequestHandler.h"
+#include "../HTTPRequestDispatcher.h"
+ 
+#include <map>
+using std::map;
+
+#include <string>
+using std::string;
+
+ 
+//handles POST request
+class PostHandler : public HTTPRequestHandler
+{
+    public:
+        PostHandler(const char* rootPath, const char* path, TCPSocket* pTCPSocket);
+        virtual ~PostHandler();
+    
+        static void mount(const string& fsPath, const string& rootPath);
+        
+        static inline HTTPRequestHandler* inst(const char* rootPath, const char* path, TCPSocket* pTCPSocket){return new PostHandler(rootPath, path, pTCPSocket);}
+        
+        virtual void doGet();
+        virtual void doPost();
+        virtual void doHead();
+        
+        virtual void onReadable();
+        virtual void onWriteable();
+        virtual void onClose();
+        
+    private:
+        FILE* m_fp;
+        bool m_err404;
+        static map<string,string> m_lFsPath;private:
+};
+
+#endif