Created
February 3, 2015 11:18
-
-
Save alikrc/a225699f484903258ec5 to your computer and use it in GitHub Desktop.
ajax post with bearer token
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.ajax({ | |
url: "http://localhost:33460/api/Account/userinfo", | |
dataType: 'json', | |
data: { | |
foo: 'bar' | |
}, | |
success: function(data, status) { | |
return console.log("The returned data", data); | |
}, | |
beforeSend: function(xhr, settings) { xhr.setRequestHeader('Authorization','Bearer ' + tokenString ); } //set tokenString before send | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@kumo70 Hi, this is ajax post with bearer token answer, already in simpliest form. I've created this 9 years ago, can be outdated. What is your problem?