Bell/cspot catchup - release

This commit is contained in:
philippe44
2023-07-25 22:28:19 -07:00
parent 4cd210838f
commit 8d4813ceb4
15 changed files with 34 additions and 44 deletions

View File

@@ -50,10 +50,12 @@ void HTTPClient::Response::rawRequest(const std::string& url,
}
socketStream << reqEnd;
// Write request body
if (content.size() > 0) {
socketStream.write((const char*)content.data(), content.size());
socketStream.write((const char*)content.data(), content.size());
}
socketStream.flush();
// Parse response
@@ -123,9 +125,9 @@ void HTTPClient::Response::get(const std::string& url, Headers headers) {
}
void HTTPClient::Response::post(const std::string& url, Headers headers,
const std::vector<uint8_t>& body) {
std::string method = "POST";
return this->rawRequest(url, method, body, headers);
const std::vector<uint8_t>& body) {
std::string method = "POST";
return this->rawRequest(url, method, body, headers);
}
size_t HTTPClient::Response::contentLength() {