我使用jquery-ajax方法POST发布授权标题,但是Firebug显示错误“401 Unauthorized”标头作为方法的参数。jQuery'POST'授权
我在做什么错?我该怎么做?
jQuery(function(dat) {
dat.ajax({
type: "POST",
url: url,
data: {
Latlng: 'coordinates.coordinates',
texts: 'text'
},
success: function(dat) {
setMarkers(dat);
},
dataType: "json"
});
});
这是OAuth的方法,我忘了(我不认为这里是什么问题,因为我把它作为示例)。
VAR URL =“HTTPS://stream.twitter的.com/1 /状态/ filter.json“; VAR存取= { 令牌: “令牌”, tokenSecret: “token_secret”, consumerKey: “CONSUMER_KEY”, consumerSecret: “CONSUMER_SECRET” }; OAuth.completeRequest(message,accessor);
var message = { action: url, method: "POST", parameters: { track: 'nutella', locations: '-180,-90,180,90' } };
OAuth.completeRequest(message,accessor);
OAuth.SignatureMethod.sign(message,accessor); url = url +'?' + OAuth.formEncode(message.parameters);
我关闭了秘密数据。
您是否检查过萤火虫中的要求标题?他们是否正确? – zerkms 2012-07-23 22:33:23
你可以发布你的代码吗? – bokonic 2012-07-23 22:34:30
你在做什么? – Wolfram 2012-07-23 22:34:31