hi everyone. i'm new at arduino and i need your helps.
i'm programming a simple automation with my uno and need to connect my web service. i've created a simple web service to test it, which returns a string and published it to my ftp. i can get response with 200 code but can not get whole response, so i can not reach my returned string.
I connect ESP8266 with SoftwareSerial.
here is the my services response that i can get from chrome
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<string xmlns="http://tempuri.org/">TEST</string>
and here is the response what i get
SEND OK
+HPD,380:HTTP/1.1 200 OK
Cache-Contsol: private, max-age=0
Contentres
s1-EePe 1Cct
od>le>O
CLOSED
OK
and finally my code here
String adres = "test.mydomain.net";
esp.println("AT+CIPSTART=\"TCP\",\"" + adres + "\",80");
delay(1000);
if(esp.find("OK")) {
Serial.println("Connected to service.");
String request = "GET /service.asmx/method?id=123 HTTP/1.0";
request += "\r\n";
request += "Host: test.mydomain.net:80";
request += "\r\n\r\n\r\n\r\n\r\n\r\n";
esp.println(request);
String cmd = "AT+CIPSEND=";
cmd += String(request.length());
esp.println(cmd);
if(esp.find(">")){
esp.println(request);
while (esp.available()) {
String tmpResp = esp.readString();
Serial.println(tmpResp);
}
}
else{
esp.println("AT+CIPCLOSE");
}
}
else {
esp.println("AT+CIPCLOSE");
}