A simple web server that can be bound to either the EthernetInterface or the WiflyInterface.

Dependents:   Smart-WiFly-WebServer WattEye X10Svr SSDP_Server

Revision:
59:9a71ac02c782
Parent:
53:e5d96abe5e9b
Child:
60:d49a346c386f
--- a/SW_HTTPServer.h	Sun Nov 18 04:04:16 2018 +0000
+++ b/SW_HTTPServer.h	Tue Feb 26 22:45:55 2019 +0000
@@ -529,6 +529,17 @@
     */
     bool RegisterHandler(const char * path, Handler callback);
 
+
+    /**
+    * Get the path for the active handler.
+    * 
+    * Useful from a callback to find out the registered path being serviced.
+    *
+    * @returns pointer to the string containing the registered path.
+    * @returns NULL if it is invalid, e.g. called from a non-callback.
+    */
+    const char * GetActiveHandlerPath(void);
+
     /**
     * determine if the named file is a supported type (htm, html, jpg, etc)
     *
@@ -619,6 +630,21 @@
         return postParamCount;
         };
 
+
+    /**
+    * Parse the provided buffer as a method='Post' process.
+    *
+    * This is called from the user code if they want the parameters to
+    * be parsed. If it is a bulk transfer, the user will not call this.
+    * But if it is a form submitted with method='post', and if the total
+    * number of parameters is small, then we can let the common code
+    * process it.
+    *
+    * @param[in] pPostString is a pointer to the string to be processed.
+    * @returns count of parameters parsed.
+    */
+    int ParsePostParameters(char * pPostString);
+
     /**
     * Parse the text string into name=value parameters.
     *
@@ -776,6 +802,7 @@
     int maxdynamicpages;
     handler *handlers;
     int handlercount;
+    int ndxActiveHandler;       // Contains the index into the list of handlers for the currently active callback
 
     char * queryType;
     char * queryString;             // the query string [and 'GET' data] passed on the URL (e.g. ?name1=value1&name2=value2...)