mirror of
https://github.com/esphome/esphome.git
synced 2026-02-28 01:44:20 -07:00
[http_request] Deprecate std::set overloads of start(), use std::vector for get()/post()
- Change get()/post() collect_headers param from std::set to std::vector (initializer list callers like online_image work unchanged) - Add ESPDEPRECATED on start() std::set overload with clear message about the collect_headers parameter
This commit is contained in:
@@ -335,7 +335,7 @@ class HttpRequestComponent : public Component {
|
||||
return this->start(url, "GET", "", request_headers);
|
||||
}
|
||||
std::shared_ptr<HttpContainer> get(const std::string &url, const std::list<Header> &request_headers,
|
||||
const std::set<std::string> &collect_headers) {
|
||||
const std::vector<std::string> &collect_headers) {
|
||||
return this->start(url, "GET", "", request_headers, collect_headers);
|
||||
}
|
||||
std::shared_ptr<HttpContainer> post(const std::string &url, const std::string &body) {
|
||||
@@ -347,7 +347,7 @@ class HttpRequestComponent : public Component {
|
||||
}
|
||||
std::shared_ptr<HttpContainer> post(const std::string &url, const std::string &body,
|
||||
const std::list<Header> &request_headers,
|
||||
const std::set<std::string> &collect_headers) {
|
||||
const std::vector<std::string> &collect_headers) {
|
||||
return this->start(url, "POST", body, request_headers, collect_headers);
|
||||
}
|
||||
|
||||
@@ -356,6 +356,9 @@ class HttpRequestComponent : public Component {
|
||||
return this->perform(url, method, body, request_headers, {});
|
||||
}
|
||||
|
||||
// Remove before 2027.1.0
|
||||
ESPDEPRECATED("Pass collect_headers as std::vector<std::string> instead of std::set. Removed in 2027.1.0.",
|
||||
"2026.7.0")
|
||||
std::shared_ptr<HttpContainer> start(const std::string &url, const std::string &method, const std::string &body,
|
||||
const std::list<Header> &request_headers,
|
||||
const std::set<std::string> &collect_headers) {
|
||||
|
||||
Reference in New Issue
Block a user