Created
December 24, 2014 00:44
-
-
Save lorenmh/17c91d8f63230353ba24 to your computer and use it in GitHub Desktop.
This file contains 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('/api/u/', { | |
type: 'POST', | |
data: JSON.stringify({}), | |
headers: { | |
'X-XSRF-TOKEN': (function() { | |
var i = document.cookie.indexOf('XSRF-TOKEN') + 11; | |
return document.cookie.substring( i , i + 32 ) | |
})() | |
}}) | |
.success(function(r) { | |
console.log(r); | |
}) | |
.fail(function(r) { | |
console.log(r.responseText); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment