| 76 | } |
| 77 | |
| 78 | bool HttpServer::methodPost(SocketClient &client) { |
| 79 | const std::string content = StringConverter::getContentFrom(client.getMessage()); |
| 80 | if (!content.empty()) { |
| 81 | const std::string file = StringConverter::getRequestedFile(client.getMessage()); |
| 82 | if (file == "/SatPI.xml") { |
| 83 | _xml.fromXML(content); |
| 84 | } |
| 85 | } |
| 86 | // setup reply |
| 87 | std::string htmlBody; |
| 88 | getHtmlBodyWithContent(htmlBody, HTML_NO_RESPONSE, "", CONTENT_TYPE_HTML, 0, 0); |
| 89 | |
| 90 | // send 'htmlBody' to client |
| 91 | if (!client.sendData(htmlBody.c_str(), htmlBody.size(), 0)) { |
| 92 | SI_LOG_ERROR("Send htmlBody failed"); |
| 93 | return false; |
| 94 | } |
| 95 | return true; |
| 96 | } |
| 97 | |
| 98 | bool HttpServer::methodGet(SocketClient &client) { |
| 99 | std::string htmlBody; |
nothing calls this directly
no test coverage detected