user59530: 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.

user4143: Do not use String. And especially do not use String in the way you are using it.
You can read more about why not here.
Instead stick to just using char* buffers.
The correct way of doing what you want is to define the buffer outside your function and then pass that buffer to the function to be populated:
int getAPIData(char *buf, int maxlen) {
  return inet.httpGET("myserver.com", 80, "/call.php?id=1&q=1&code=1001", buf, maxlen);
}

Then you call it with:
char *my_buffer[450];
getAPIData(my_buffer, 450);
Serial.println(my_buffer);


59530: <pre><code>String getAPIData()
{
  char res_buffer[450];
  int numdata = inet.httpGET("myserver.com", 80, "/call.php?id=1&amp;q=1&amp;code=1001", res_buffer, 450);
  String result = String(res_buffer);
  Serial.println(result);
  Serial.println(numdata);
  return result;
}
</code></pre>

<p>Output on Serial: </p>

<pre><code>15:52:07.208 -&gt; 
15:52:07.208 -&gt; 393
</code></pre>

<p>But, When I print the buffer by loop I got the below output:</p>

<pre><code>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
</code></pre>

<p>I am not sure why the char buffer is not converting to String in Arduino UNO.</p>

<p>Any known issues ? Please suggest if any correction required.</p>
 4143: <p>Do not use String. And especially do not use String in the way you are using it.</p>

<p>You can read more about why not <a href="https://majenko.co.uk/blog/evils-arduino-strings" rel="nofollow noreferrer">here</a>.</p>

<p>Instead stick to just using <code>char*</code> buffers.</p>

<p>The correct way of doing what you want is to define the buffer outside your function and then pass that buffer to the function to be populated:</p>

<pre><code>int getAPIData(char *buf, int maxlen) {
  return inet.httpGET("myserver.com", 80, "/call.php?id=1&amp;q=1&amp;code=1001", buf, maxlen);
}
</code></pre>

<p>Then you call it with:</p>

<pre><code>char *my_buffer[450];
getAPIData(my_buffer, 450);
Serial.println(my_buffer);
</code></pre>
