获取我的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);
}
});