在尝试发布到Tumblr博客时不断获得401

时间:2011-08-06 06:31:47

标签: tumblr

我不断获得401,而没有进一步解释通过v2 API发布到Tumblr时的错误。

请求低于 - 为可读性添加了换行符

POST http://api.tumblr.com/v2/blog/[blog].tumblr.com/post HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Host: api.tumblr.com
Content-Length: 303

body=test&
oauth_consumer_key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&
oauth_nonce=4712451&
oauth_signature_method=HMAC-SHA1&
oauth_timestamp=1312610497&
oauth_token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&
oauth_version=1.0&
type=text&
oauth_signature=ccN%2f0E%2bat42BAzdkDPJ%2ffcuMacY%3d

我得到以下回复

HTTP/1.1 401 Not Authorized
Date: Sat, 06 Aug 2011 06:01:43 GMT
Server: Apache
P3P: CP="ALL ADM DEV PSAi COM OUR OTRo STP IND ONL"
Vary: Accept-Encoding
X-Tumblr-Usec: D=38791
Content-Length: 60
Connection: close
Content-Type: application/json

{"meta":{"status":401,"msg":"Not Authorized"},"response":[]}

有人能发现原因吗?

1 个答案:

答案 0 :(得分:0)

您可以在此处查看基本字符串

http://quonos.nl/oauthTester/

你可以在这里查看所有内容

http://hueniverse.com/oauth/guide/authentication/

另外,当我的签名包括一个+时,我个人遇到了一些麻烦,就像你上面的那样,(+ =%2b urlencoded)。我通过在我的签名中测试+并在重新签名时解决了这个问题。

相关问题