2013-03-01 92 views
1

我试图用cURL和PHP标记在Google阅读器上阅读的项目。我正在使用OAuth 2.0向我的应用程序请求Google Reader许可。当我试图标志的项目为已读,拿到 “400错误的请求” HTTP错误,我的要求是这样的:向Google阅读器发送POST请求(标记为readed)

网址:https://www.google.com/reader/api/0/edit-tag

网址参数:

[client] => scroll 

post数据:

[i] => tag:google.com,2005:reader/item/b25079e56615b397 
[s] => feed/http://christophertimberlake.com/rss 
[async] => true 
[T] => <Access token got on OAuth2 sign-in> 
[a] => user/<user-id>/state/com.google/read 

请求头:

[Host] => www.google.com 
[Accept] => */* 
[Authorization] => Bearer <OAuth2 access token> 
[Referer] => http://www.google.com/reader/view/ 
[User-Agent] => Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:19.0) Gecko/20100101 Firefox/19.0 
[Content-Length] => 247 
[Content-Type] => application/x-www-form-urlencoded 

另外,我注意到Google的一个奇怪的响应标题:X-reader-google-bad-token: true。此标题与POST发送的令牌相关,是否必须将OAuth2令牌用作POST参数,或者我需要另一个令牌?

请注意,我已成功执行只读请求,如获取订阅,项目列表或读取计数信息。

有人知道这里发生了什么吗?

回答