【问题标题】:What is wrong with this OAuth request to the Pocket API?这个对 Pocket API 的 OAuth 请求有什么问题?
【发布时间】:2014-06-05 01:14:13
【问题描述】:

我正在尝试使用 Pocket API 构建一个简单的脚本,并且在遵循 site 上的文档时收到 400 错误请求。这是我得到的:

POST /v3/oauth/request?consumer_key=xxxxxx-
xxxxxxxxxxxxxxxxxxx&redirect_uri=http://localhost:3000/callback HTTP/1.1
Host: getpocket.com
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded

我正在使用 Postman,并且正在从 rails 服务器运行 redirect_uri。

附加信息:

Cache-Control →private
Connection →keep-alive
Content-Length →15
Content-Type →text/html; charset=UTF-8
Date →Mon, 21 Apr 2014 01:17:05 GMT
Expires →Thu, 19 Nov 1981 08:52:00 GMT
P3P →policyref="/w3c/p3p.xml", CP="ALL CURa ADMa DEVa OUR IND UNI COM NAV INT STA PRE"
Pragma →no-cache
Server →Apache
Status →400 Bad Request
X-Error →Missing consumer key.
X-Error-Code →138
X-Source →Pocket

在搜索给我 400 的 x 错误代码时,我发现它给了我一个丢失的消费者密钥。我很茫然,因为这是一个全新的密钥,我当然正确地使用它。有什么想法吗?

【问题讨论】:

    标签: ruby api post ruby-on-rails-4 oauth


    【解决方案1】:

    您将 consumer_key 和 redirect_uri 作为 url 参数发送?consumer_key=xxxxxx..

    正确的方法是将它们作为表单数据参数发送:

    【讨论】:

      猜你喜欢
      • 2019-01-21
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-02-17
      • 2018-11-25
      • 2012-08-13
      • 1970-01-01
      相关资源
      最近更新 更多