2011-08-06 51 views
4

我得到一个401不断进一步解释什么错误是通过v2 API张贴到Tumblr时。不断得到401当试图张贴到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":[]} 

有谁可以发现,为什么?

+0

我解决了这个问题,提供了一个非空白的tumblr秘密 - http://stackoverflow.com/questions/4849819/tumblr-oauth-image-post-gives-me-401-invalid-oauth-credentials/7141120# 7141120 – Ponny

回答

0

您可以点击这里您的基础线

http://quonos.nl/oauthTester/

,你可以检查这里的一切

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

另外,我个人有过一些麻烦时,我的签名包含一个+ ,正如你在上面所做的那样,(+ =%2b urlencoded)。我通过在我的签名中测试+来解决问题,如果确实需要重新签名。

+0

嗨克里斯,我得到401(未授权)在Tumblr发布reblog API调用,其他tumblr apis工作正常。 API响应:{“meta”:{“status”:401,“msg”:“未授权”},“响应”:[]}。 –

+0

在我的情况下,我收到了一个401,因为忘记了第一步中获得的oauth_token_secret。甚至没有想过要查找它,因为他们引用了Twitter的API,它不使用它。 –