Handle HTTP Post Method
Dependencies: EthernetNetIf HTTPServer mbed
PostHandler.h
00001 #ifndef POST_HANDLER_H 00002 #define POST_HANDLER_H 00003 00004 #include <HTTPRequestHandler.h> 00005 00006 class PostHandler : public HTTPRequestHandler 00007 { 00008 public: 00009 PostHandler(const char* rootPath, const char* path, TCPSocket* pTCPSocket); 00010 virtual ~PostHandler(); 00011 00012 static inline HTTPRequestHandler* inst(const char* rootPath, const char* path, TCPSocket* pTCPSocket) { return new PostHandler(rootPath, path, pTCPSocket); } //if we ever could do static virtual functions, this would be one 00013 00014 virtual void doGet(); 00015 virtual void doPost(); 00016 virtual void doHead(); 00017 00018 virtual void onReadable(); //Data has been read 00019 virtual void onWriteable(); //Data has been written & buf is free 00020 virtual void onClose(); //Connection is closing 00021 00022 private: 00023 void printString( const char* pszString ); 00024 void printHtml(); 00025 }; 00026 00027 #endif
Generated on Thu Jul 14 2022 01:16:29 by 1.7.2