-
-
Save mindmergedesign/e0f4517d2e2cf6ed7d3478cb87a9f4d7 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