A simple web server that can be bound to either the EthernetInterface or the WiflyInterface.
Dependents: Smart-WiFly-WebServer WattEye X10Svr SSDP_Server
Diff: SW_HTTPServer.h
- Revision:
- 53:e5d96abe5e9b
- Parent:
- 49:cd391662f254
- Child:
- 59:9a71ac02c782
--- a/SW_HTTPServer.h Tue Apr 11 18:53:04 2017 +0000 +++ b/SW_HTTPServer.h Sun Jun 10 22:24:54 2018 +0000 @@ -288,7 +288,7 @@ * number of bytes being passed in the path parameters. * @return one of the @see CallBackResults signals indicating error or successes */ - typedef CallBackResults (* Handler)(HTTPServer * svr, CallBackType type, const char *path, + typedef CallBackResults (* Handler)(HTTPServer * svr, CallBackType type, char *path, const namevalue *queryParams, int queryParamCount); /** @@ -444,8 +444,9 @@ * * @param[in] msg is the text string to send * @param[in] bytes is the number of bytes to send. If not set, then strlen is calculated. + * @returns # of bytes sent, and < 0 for various error codes. */ - void send(const char * msg, int bytes = -1); + int send(const char * msg, int bytes = -1); /** * Get the size of the file @@ -482,7 +483,7 @@ * svr.RegisterHandler("/dyn1", SimpleDynamicPage); * ... * - * HTTPServer::CallBackResults SimpleDynamicPage(HTTPServer *svr, HTTPServer::CallBackType type, const char * path, + * HTTPServer::CallBackResults SimpleDynamicPage(HTTPServer *svr, HTTPServer::CallBackType type, char * path, * const HTTPServer::namevalue *queryParams, int queryParamCount) { * char buf[100]; * HTTPServer::CallBackResults ret = HTTPServer::ACCEPT_ERROR;