Created
May 13, 2015 19:22
-
-
Save ikwattro/505a18e2c218c4f440b1 to your computer and use it in GitHub Desktop.
Neo4j + jquery
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
var token = user + ':' +pwd; | |
var hash = btoa(token); | |
var authHeader = 'Basic ' + hash; | |
$.ajax({ | |
url: endpoint, | |
type: "POST", | |
beforeSend: function (xhr){ | |
xhr.setRequestHeader('Authorization', authHeader); | |
}, | |
data: data, | |
async: false, | |
contentType: "application/json" | |
}) | |
.done(function(result){ | |
console.log(result); | |
neoError = result.errors; | |
}) | |
.fail(function(error){ | |
console.log(error.statusText); | |
displayError(error.statusText); | |
return false; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment