【发布时间】:2013-06-17 12:52:29
【问题描述】:
我能够为 Tumblr 博客执行 GET 方法, 但是每当我尝试为 Tumblr 执行 POST 方法时,我都会收到一个错误::
({"meta":{"status":401,"msg":"Not Authorized"},"response":[]});
我正在为 Ajax Post 使用以下代码::
$.ajax({
type: 'POST',
url: 'https://api.tumblr.com/v2/blog/firstblgpsa.tumblr.com/post',
dataType: "jsonp",
data: {
api_key: "*key here*",
type: 'text',
title: 'First_Post',
body:'This is My First Post to Tumblr.'
},
success:function(){
alert("Blog Posted Successfully!!");
}
})
【问题讨论】:
-
jsonp不支持 POST 方法。更准确地说,你不能在跨域ajax中使用GET以外的方法。 stackoverflow.com/questions/4508198/… -
但是如果我想在我的 Tumblr 博客中发布一些文字该怎么办。
-
我认为您不希望其他人开始使用您的密钥并代表您上传内容,删除了您的密钥。
标签: javascript jquery ajax tumblr