Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: ESP8266_WebServer mbed
Fork of WiFiLamp by
Diff: ESP8266_WebServer/ESP8266_WebServer.h
- Revision:
- 11:3ab606a42227
- Parent:
- 9:319aeb6e0123
- Child:
- 20:f5a6527bfda6
diff -r 319aeb6e0123 -r 3ab606a42227 ESP8266_WebServer/ESP8266_WebServer.h
--- a/ESP8266_WebServer/ESP8266_WebServer.h	Sat Dec 27 05:56:47 2014 +0000
+++ b/ESP8266_WebServer/ESP8266_WebServer.h	Sun Dec 28 16:04:22 2014 +0000
@@ -5,6 +5,12 @@
 #ifndef _ESP8266_WEB_SERVER_H
 #define _ESP8266_WEB_SERVER_H
 
+const char mimeHTML[] = "text/html";
+const char mimeJavaScript[] = "text/javascript";
+const char mimeCSS[] = "text/css";
+const char mimeJPEG[] = "image/jpeg";
+const char mimePNG[] = "image/png";
+
 class ESP8266_WebRequest
 {
     char httpMethod[64];
@@ -30,7 +36,7 @@
         short data_waiting(void);
         short string_waiting(const char*);
         void readBuffer(void);
-        void sendResponse(int linkID);
+        void sendResponse(int linkID, int numBytes);
         
     public:
         Serial *debugSerial;
@@ -39,8 +45,11 @@
         void rxint(void);
         void Initialize(void);
         ESP8266_WebRequest* GetRequest(void);
-        void SendHTMLReply(int linkID, std::string reply);
-        void Send404Reply(int linkID);
+        void SendError(int linkID, std::string error);
+        void SendError(int linkID, const char* error);
+        void Send404Error(int linkID);
+        void SendReply(int linkID, std::string reply, const char* mimeType);
+        void SendReply(int linkID, const char* reply, int replySize, const char* mimeType);
 };
 
 #endif
\ No newline at end of file
    