tengo un problema...tengo una petición ajax jquery a un webapi que espera un token. Agrego la cabecera Authorization Bearer+Token pero éste no llega al web api...expongo el código:
$.ajax({
url : 'http://localhost:59596/Prueba',
data : {},
dataType : 'jsonp',
success : function(json) {
debugger;
},
beforeSend: function(xhr, settings) {
xhr.setRequestHeader('Authorization','Bearer 93854545454545454' );
},
error : function(xhr, status) {
alert('Disculpe, existió un problema');
},
complete : function(xhr, status) {
alert('Petición realizada');
}
});
También lo he probado de esta forma:
$.ajax({
url : 'http://localhost:59596/Prueba',
data : {},
dataType : 'jsonp',
success : function(json) {
debugger;
},
beforeSend: function(xhr, settings) {
xhr.setRequestHeader('Authorization','Bearer 93854545454545454' );
},
error : function(xhr, status) {
alert('Disculpe, existió un problema');
},
complete : function(xhr, status) {
alert('Petición realizada');
}
});
De ninguna forma llega...lo más curioso es que desde postman, llega