HTTPServer

Dependents:   HTTPServerCustom

Fork of HTTPServer by Donatien Garnier

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers PostHandler.h Source File

PostHandler.h

00001 #ifndef POST_HANDLER_H
00002 #define POST_HANDLER_H
00003 #include "../HTTPRequestHandler.h"
00004 #include "../HTTPRequestDispatcher.h"
00005  
00006 #include <map>
00007 using std::map;
00008 
00009 #include <string>
00010 using std::string;
00011 
00012  
00013 //handles POST request
00014 class PostHandler : public HTTPRequestHandler
00015 {
00016     public:
00017         PostHandler(const char* rootPath, const char* path, TCPSocket* pTCPSocket);
00018         virtual ~PostHandler();
00019     
00020         static void mount(const string& fsPath, const string& rootPath);
00021         
00022         static inline HTTPRequestHandler* inst(const char* rootPath, const char* path, TCPSocket* pTCPSocket){return new PostHandler(rootPath, path, pTCPSocket);}
00023         
00024         virtual void doGet();
00025         virtual void doPost();
00026         virtual void doHead();
00027         
00028         virtual void onReadable();
00029         virtual void onWriteable();
00030         virtual void onClose();
00031         
00032     private:
00033         FILE* m_fp;
00034         bool m_err404;
00035         static map<string,string> m_lFsPath;private:
00036 };
00037 
00038 #endif