对Google阅读器的POST请求(标记为已读)

时间:2013-03-01 13:26:10

标签: curl oauth-2.0 google-reader

我正在尝试使用cURL和PHP在Google阅读器上标记一个项目。我正在使用OAuth 2.0为我的应用程序请求Google阅读器权限。当我尝试将项目标记为已读时,遇到“400 Bad Request”HTTP错误,我的请求如下:

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

网址参数:

[client] => scroll

POST Params:

[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参数,或者我需要另一个令牌?

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

有谁知道这里发生了什么?

1 个答案:

答案 0 :(得分:0)

我解决了我的问题,使用OAuth2我还需要一个动作令牌来执行非只读操作。

查看更多

https://groups.google.com/forum/?fromgroups=#!topic/fougrapi/U_8eT4yyLsY

相关问题