Php 使用POST时如何调试GoogleCharts API?
对于GET有一些建议,但对于POST没有任何建议 目前,我只是一次删除一个帖子属性,直到它不再被破坏 有更好的办法吗 嗯,疑难解答页面建议使用chof=validate重新提交GET请求或粘贴到-有没有快速的方法将GET转换为POST 它有这么简单吗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
$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;
}