2013-03-01 95 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參數,或者我需要另一個令牌?

請注意,我已成功執行只讀請求,如獲取訂閱,項目列表或讀取計數信息。

有人知道這裏發生了什麼嗎?

回答