void RPCHandler::doGet() { DBG("\r\nIn RPCHandler::doGet()\r\n"); char resp[RPC_DATA_LEN] = {0}; char req[RPC_DATA_LEN] = {0}; DBG("\r\nPath : %s\r\n", path().c_str()); DBG("\r\nRoot Path : %s\r\n", rootPath().c_str()); //Remove path strncpy(req, path().c_str(), RPC_DATA_LEN-1); DBG("\r\nRPC req : %s\r\n", req); //Remove %20, +, from req cleanReq(req); DBG("\r\nRPC req : %s\r\n", req); //Do RPC Call mbed::rpc(req, resp); //FIXME: Use bool result //Response setContentLen( strlen(resp) ); //Make sure that the browser won't cache this request respHeaders()["Cache-control"]="no-cache;no-store"; // respHeaders()["Cache-control"]="no-store"; respHeaders()["Pragma"]="no-cache"; respHeaders()["Expires"]="0"; //Write data respHeaders()["Connection"] = "close"; writeData(resp, strlen(resp)); DBG("\r\nExit RPCHandler::doGet()\r\n"); }
void SimpleHandler::doGet() { DBG("\r\nIn SimpleHandler::doGet()\r\n"); const char* resp = "Hello world !"; setContentLen( strlen(resp) ); respHeaders()["Connection"] = "close"; writeData(resp, strlen(resp)); DBG("\r\nExit SimpleHandler::doGet()\r\n"); }
void SimpleHandler::doGet() { #ifdef _DEBUG_SIMPLE_HANDLER DMBoard::instance().logger()->printf("++++(SimpleHeader) doGet()\r\n"); #endif const char* resp = "Hello world !"; setContentLen( strlen(resp) ); respHeaders()["Connection"] = "close"; writeData(resp, strlen(resp)); #ifdef _DEBUG_SIMPLE_HANDLER DMBoard::instance().logger()->printf("++++(SimpleHeader) doGet Exit\r\n"); #endif }