I have a problem ... I have an ajax jquery request to a webapi waiting for a token. I add the Authorization Bearer + Token header but it does not reach the web api ... I expose the code:
$.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');
}
});
I've also tried it this way:
$.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');
}
});
In no way comes ... the most curious thing is that since postman, comes