Ajax调用获得411长度所需的错误

时间:2015-08-23 15:15:44

标签: javascript jquery ajax get bearer-token

获取我的ajax调用请求获取411长度所需的错误。 当通过Firefox浏览器的rest-client传递令牌时,我的请求正常工作

非常感谢你的帮助......

$.ajax(
'https://example.site.net/users/me/recent',
{
type: 'GET',
beforeSend: function (xhr) {
  xhr.setRequestHeader("Content-Type","application/json");
  xhr.setRequestHeader("Accept","text/json");
  xhr.setRequestHeader("Authorization","Bearer token");
  xhr.setRequestHeader("Access-Control-Allow-Headers", "*");
  console.log('Fired prior to the request');
},
complete: function (resp) {
  console.log(resp);
}
});

0 个答案:

没有答案