HTTPServer / ZacsProgram

Dependents:   HTTPServerCustom

Fork of HTTPServer by Donatien Garnier

LPC1768/services/http/server/impl/PostHandler.h

Committer:
wellmon7
Date:
2014-09-29
Revision:
7:8570ffb99cba
Parent:
LPC1768/services/http/server/impl/SimpleHandler.h@ 0:52230c56755e

File content as of revision 7:8570ffb99cba:

#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