Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/266.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 使用POST时如何调试GoogleCharts API?_Php_Google Visualization - Fatal编程技术网

Php 使用POST时如何调试GoogleCharts API?

Php 使用POST时如何调试GoogleCharts API?,php,google-visualization,Php,Google Visualization,对于GET有一些建议,但对于POST没有任何建议 目前,我只是一次删除一个帖子属性,直到它不再被破坏 有更好的办法吗 嗯,疑难解答页面建议使用chof=validate重新提交GET请求或粘贴到-有没有快速的方法将GET转换为POST 它有这么简单吗 $contextArray = array("http" => array( "method" => "POST", "content" => http_build_query($chart, "", "&a

对于GET有一些建议,但对于POST没有任何建议

目前,我只是一次删除一个帖子属性,直到它不再被破坏

有更好的办法吗

嗯,疑难解答页面建议使用chof=validate重新提交GET请求或粘贴到-有没有快速的方法将GET转换为POST

它有这么简单吗

  $contextArray =  array("http" => array(
    "method" => "POST",
    "content" => http_build_query($chart, "", "&")));

以下是一个链接,用于将POST与谷歌图表结合使用:

不确定你想做什么

要使用$_GET['']值从PHP发送帖子,可以将值添加到$data数组中,并使用以下函数发送帖子-或者使用CURL

public function sendPostData($url, $data, $optional_headers = null)
    {
      $params = array('http' => array(
                  'method' => 'POST',
                  'content' => $data
                ));

      if ($optional_headers !== null) 
      {
        $params['http']['header'] = $optional_headers;
      }

      $ctx = stream_context_create($params);
      $fp = @fopen($url, 'rb', false, $ctx);
      if (!$fp) 
      {
        throw new Exception("Problem with $url, $php_errormsg");
      }

      $response = @stream_get_contents($fp);
      if ($response === false) 
      {
        throw new Exception("Problem reading data from $url, $php_errormsg");
      }

      return $response;
    }