【发布时间】:2011-05-16 19:54:20
【问题描述】:
有人能指出我在哪里做错了吗?
<?php
if(!empty($_GET))
{
if(isset($_GET['token']))
{
$token = $_GET['token'];
$ch = curl_init('https://www.google.com/m8/feeds/');
if($ch)
{
curl_setopt
(
$ch,
CURLOPT_HTTPHEADER,
array
(
/* "Content-Type: application/x-www-form-urlencoded",*/
"Authorization: AuthSub token=\"{$token}\""
)
);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
//curl_setopt($ch,CURLOPT_FOLLOWLOCATION,true);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);
curl_setopt($ch,CURLOPT_HTTPGET,true);
curl_setopt($ch,CURLOPT_HTTP_VERSION,CURL_HTTP_VERSION_1_1);
curl_setopt($ch,CURLOPT_HEADER,true);
//curl_setopt($ch,CURLOPT_POST,true);
$res = curl_exec($ch);
echo $res.'<br />';
}
}
}
?>
这是我用来将用户重定向到谷歌的链接-
它一直给我这个 -
HTTP/1.1 400 Bad Request
内容类型:文本/html; 字符集=UTF-8 日期:2010 年 11 月 28 日星期日 09:59:53 GMT 过期:星期日,2010 年 11 月 28 日 09:59:53 GMT 缓存控制:私有,max-age=0 X-Content-Type-Options: nosniff X 框架选项:SAMEORIGIN X-XSS-防护:1; 模式=块服务器:GSE 传输编码:分块
请求 URI 无效
有人知道吗?我知道我在一个或多个地方错了,但我的大脑无法正常工作,因为我尝试了将近 4 个小时:D
谢谢, 安詹
【问题讨论】:
标签: oauth google-api google-contacts-api authsub