How to communicate with ESP8266 ESP01 by sending data through softwareserial on Arduino Uno?
How about this:

void loop() {
  while(Serial.available() &gt; 0) {
     myESP.write(Serial.read());
  }
  while(myESP.available() &gt; 0) {
     Serial.write(myESP.read());
  }
}


That code will continue to load data to and from the software serial not just one byte. You can also use string concatenation:

String data = "";
while(Serial.available() &gt; 0) {
   data += Serial.read();
}


Or arrays:

int data_max = 4096;
int data_size = 0;
char data[data_max];
while(Serial.available() &gt; 0) {
   if(data_size &lt; data_max) data[data_size++] = Serial.read();
}