I'm trying to use google chart sending post parametars, but always get
image: The image “URL” cannot be displayed, because it contains
errors.

Here is 2 methods I'm trying:

1.
$context = stream_context_create(
    array('http' => array(
     'method' => 'POST',
      'content' => http_build_query($this->_post),
        'header' => "Content-Type: application/x-www-form-urlencoded\r
\n")));

          header('content-type: image/png');
  fpassthru(fopen('http://chart.apis.google.com/chart', 'r', false,
$context));

2.

                $ch = curl_init('http://chart.apis.google.com/chart?
chid='.md5(uniqid(rand(), true)).'&'.http_build_query($this->_post));
                curl_setopt($ch, CURLOPT_HEADER, 1);
                curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
                curl_setopt($ch,CURLOPT_POST,count($this->_post));
 
curl_setopt($ch,CURLOPT_POSTFIELDS,http_build_query($this->_post));
                $response = curl_exec($ch);

header('Content-Type: image/png');
echo $response;

In both cases I get same error.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Chart API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-chart-api?hl=en.

Reply via email to