次の python 関数を使用して、アイテムを Google リーダーで既読としてマークしますが、常にエラー HTTPErrors: HTTP 401: Unauthorized: を返します。
def mark_as_read (SID, entryid): トークン = get_token(SID) mark_as_read_url = 'http://www.google.com/reader/api/0/edit-tag' ヘッダー = {'Content-type': 'application/x-www-form-urlencoded'} post_data = urllib.urlencode({ 'i': エントリ ID、'a': 'user/-/state/com.google/read'、'ac': 'edit'、'T': トークン }) request = urllib2.Request(mark_as_read_url, post_data, header) f = urllib2.urlopen(リクエスト) 結果 = f.read()
他の機能はフィードとエントリを正常に取得しているため、ユーザー名やパスワードの誤りなどの基本的なことではありません。urlencoding が必要であると読んだので、それを実行しました。サンプルの entryid は次のようになります: tag:google.com,2005:reader/item/f66ad0fb64f56a22
私は何を間違っていますか?