diff --git a/esphome/components/http_request/http_request.cpp b/esphome/components/http_request/http_request.cpp index 390867c948..46b0910b5e 100644 --- a/esphome/components/http_request/http_request.cpp +++ b/esphome/components/http_request/http_request.cpp @@ -15,15 +15,15 @@ void HttpRequestComponent::dump_config() { void HttpRequestComponent::send() { bool begin_status = false; this->client_.setReuse(true); - static const String URL = this->url_.c_str(); + const String url = this->url_.c_str(); #ifdef ARDUINO_ARCH_ESP32 - begin_status = this->client_.begin(URL); + begin_status = this->client_.begin(url); #endif #ifdef ARDUINO_ARCH_ESP8266 #ifndef CLANG_TIDY this->client_.setFollowRedirects(true); this->client_.setRedirectLimit(3); - begin_status = this->client_.begin(*this->get_wifi_client_(), URL); + begin_status = this->client_.begin(*this->get_wifi_client_(), url); #endif #endif