ESP 01 button

Hi,

I'm trying to make ESP01 a button that, when pressed, sends reguest to the url.

If I have ESP connected via a programmer, then everything works. But if I connect only the power supply, then after pressing the button, a request is constantly sent to the url every 5 seconds and never stops.

Any ideas where the problem might be?

#include 
#include 

const char* ssid = "Camrak";
const char* password = "pass";
const int BUTTON=2;

void setup () {
  pinMode(BUTTON,INPUT);
  Serial.print("Setup");
  Serial.begin(115200);
  WiFi.begin(ssid, password);
  while (WiFi.status() != WL_CONNECTED) {
    delay(1000);
   Serial.print("Connecting..");
  }

}


void loop() {


if(digitalRead(BUTTON)==LOW)
{
  if (WiFi.status() == WL_CONNECTED) { 
    HTTPClient http;  
    http.begin("http://192.168.1.14:8080/doorbell?Zvonek");  
    int httpCode = http.GET();                                 

    if (httpCode > 0) { 

      String payload = http.getString();   
      Serial.println(payload);             
    }
    http.end();   
  }

  delay(5000);   
}
else
{}

}

connect external pull up resistor (10k) to the button pin

Thank you for the advice. But the resistor didn't help.