我正在使用某个服务器的api,我发送了一个获取请求:
$r = new HttpRequest('https://server.com/chart.png', HttpRequest::METH_GET);
$r->addQueryData(array('type' => 'graph'));
$r->addQueryData(array('width' => 900));
$r->addQueryData(array('height' => 420));
$r->addQueryData(array('graphid' => 1));
$r->addQueryData(array('id' => 1234));
$r->addQueryData(array('username' => 'userName'));
$r->addQueryData(array('passhash' => 'passHash'));
我收到200回复:
我该怎么做才能打印这个png?
如果我print_r($ r),我看到:
[responseMessage:HttpRequest:private] => HttpMessage Object
(
[type:protected] => 2
[body:protected] => ?PNG
IHDR?i}?$ IDATx??y?$?}?????????g??Ā ?H(?C?n??k?i\?K?imP!Ӓ,
///and so on....
所以图像在那里,我只是不知道如何访问它。