Arduino Mega 2560 ESP8266 problem

Look for web client examples where the sketch uses AT commands.

.