String getAPIData()
{
char res_buffer[450];
int numdata = inet.httpGET("myserver.com", 80, "/call.php?id=1&q=1&code=1001", res_buffer, 450);
String result = String(res_buffer);
Serial.println(result);
Serial.println(numdata);
return result;
}
Output on Serial:
15:52:07.208 ->
15:52:07.208 -> 393
But, When I print the buffer by loop I got the below output:
HTTP/1.1 200 OK
Date: Mon, 16 Sep 2019 06:28:59 GMT
Server: Apache
X-Powered-By: PHP/7.2.20
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Set-Cookie: PHPSESSID=5b21eeac22dcf61f2e4d2efd579d437c; path=/
Upgrade: h2,h2c
Connection: Upgrade, close
Vary: Accept-Encoding,User-Agent
Content-Type: text/html; charset=UTF-8
-1
I am not sure why the char buffer is not converting to String in Arduino UNO.
Any known issues ? Please suggest if any correction required.