This is different from the linked duplicate question because the other question does not explain how to display the body as an image instead of the encoded text.
I have a GET API call that is returning back a UTF-8 PNG image. I am making the call from PHP and want to display the PNG thumbnail embedded in the webpage. Can someone help me figure out how to display the image inline with the rest of the webpage? So far I am just taking the CURL response and echoing it out to the page. Here is what I see. Thank you in advance.
$curl = curl_init();
curl_setopt($curl,CURLOPT_URL,'$url');
curl_setopt($curl,CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl,CURLOPT_USERAGENT,'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.52 Safari/537.17');
curl_setopt($curl,CURLOPT_HEADER, true);
curl_setopt($curl, CURLOPT_VERBOSE, 1);
$headers = array( 'X-Tableau-Auth: ' . $GLOBALS['authToken'] );
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
$resp = curl_exec($curl);
echo $resp;
$header_size = curl_getinfo($curl, CURLINFO_HEADER_SIZE);
$header = substr($resp, 0, $header_size);
$body = substr($resp, $header_size);
echo $body;
curl_close($curl);