【发布时间】:2016-06-25 23:33:00
【问题描述】:
我正在尝试使用 Twitter API 中的 verify_credentials endpoint。我想将include_entities 参数设置为false。我可以使用第一个示例进行身份验证(所以我知道我的 oauth_options 值是正确的),但是如果我尝试设置 include_entities 参数,我会收到此错误 {"code"=>32, "message"=>"Could not authenticate you."}。注意:我无法使用 Twitter gem。
作品:
response = HTTParty.get("https://api.twitter.com/1.1/account/verify_credentials.json", headers: {"Authorization" => oauth_options})
不起作用:
response = HTTParty.get("https://api.twitter.com/1.1/account/verify_credentials.json", headers: {"Authorization" => oauth_options}, query: {include_entities: false})
也不起作用
response = HTTParty.get("https://api.twitter.com/1.1/account/verify_credentials.json?include_entities=false", headers: {"Authorization" => oauth_options})
【问题讨论】:
-
因此包含此查询参数将更改计算的授权值,因为它们包含在签名过程中。你是怎么产生的?
-
我没有意识到这一点。我认为这就是问题所在。
-
P.S.,如果你想把这个作为答案,我会把它标记为正确的。
标签: ruby-on-rails twitter httparty