ESP8266 reading response

Hi

Loving the Arduino and ESP8266 !

One slight issue, I'm sending some data as a get request to one of my web servers via a PHP script into a MYSql table, its updating fine to the table but would like the arduino to read the response of "DATA RECEIVED" or DATA ERROR" depending if its successful. The PHP script works fine and the response shows when its pasted into the address bar on a web browser.

I have manged to retrieve the Date from the Header response but not the body, any ideas ?

Cheers

Stu

do you request via intranet o internet?, i had the same trouble, i solved it by adding a delay after request.

void obtenerDatosTicket()
{
  if(!cliente.connected())
  {
    httpRequest();
    delay(350);
    
    _cadena = "";
    while(cliente.available())
    {
      c = cliente.read();
      _cadena = _cadena + c;
      delay(1);
    }
    cliente.stop();
    cliente.flush();
  }
  else
  {
    cliente.stop();
    cliente.flush();
  }
}
void httpRequest()
{
  if(cliente.connect(servidor, 80))
  {
    cliente.print(_pagina);
    cliente.print(_codigo);
    cliente.println(" HTTP/1.0");
    cliente.println("Host: servidor-xp");
    cliente.println("User-Agent: arduino-ethernet");
    cliente.println("Connection: close");
    cliente.println("Content-Type: text/html");
    cliente.println();
  } 
  else
  {
    cliente.stop();
    cliente.flush();
  }
}

variable _cadena contains all the requested info. You only have to read and find the result

I hope it worth for you

Thanks for the reply, have added the delay and it did work for 4 uploads then stopped, unable to connect. Will check the firmware and also the speed at which i update to the server - ideally it would be every 10 mins but for testing its a bit quicker and think that may be the issue.

Cheers

Stu