fit the memory usage for esp32c3

This commit is contained in:
Terrence
2024-11-29 11:06:05 +08:00
parent ff28586c35
commit 436ff2b906
35 changed files with 754 additions and 360 deletions

View File

@@ -50,11 +50,11 @@ bool Ota::CheckVersion() {
}
http->SetHeader("Content-Type", "application/json");
if (post_data_.length() > 0) {
http->SetContent(post_data_);
http->Open("POST", check_version_url_);
} else {
http->Open("GET", check_version_url_);
std::string method = post_data_.length() > 0 ? "POST" : "GET";
if (!http->Open(method, check_version_url_, post_data_)) {
ESP_LOGE(TAG, "Failed to open HTTP connection");
delete http;
return false;
}
auto response = http->GetBody();