[http_request] Rename response_headers param to collect_headers in host

Align with IDF and Arduino implementations where the parameter is
named collect_headers.
This commit is contained in:
J. Nick Koston
2026-02-16 18:59:20 -06:00
parent aa3ac552c8
commit 2b21c0a2b2
2 changed files with 3 additions and 3 deletions

View File

@@ -19,7 +19,7 @@ static const char *const TAG = "http_request.host";
std::shared_ptr<HttpContainer> HttpRequestHost::perform(const std::string &url, const std::string &method,
const std::string &body,
const std::list<Header> &request_headers,
const std::vector<std::string> &response_headers) {
const std::vector<std::string> &collect_headers) {
if (!network::is_connected()) {
this->status_momentary_error("failed", 1000);
ESP_LOGW(TAG, "HTTP Request failed; Not connected to network");
@@ -116,7 +116,7 @@ std::shared_ptr<HttpContainer> HttpRequestHost::perform(const std::string &url,
for (auto header : response.headers) {
ESP_LOGD(TAG, "Header: %s: %s", header.first.c_str(), header.second.c_str());
auto lower_name = str_lower_case(header.first);
if (should_collect_header(response_headers, lower_name)) {
if (should_collect_header(collect_headers, lower_name)) {
container->response_headers_.push_back({lower_name, header.second});
}
}

View File

@@ -20,7 +20,7 @@ class HttpRequestHost : public HttpRequestComponent {
public:
std::shared_ptr<HttpContainer> perform(const std::string &url, const std::string &method, const std::string &body,
const std::list<Header> &request_headers,
const std::vector<std::string> &response_headers) override;
const std::vector<std::string> &collect_headers) override;
void set_ca_path(const char *ca_path) { this->ca_path_ = ca_path; }
protected: