Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ralfbecher/61488a276e9fff6314aa to your computer and use it in GitHub Desktop.
Save ralfbecher/61488a276e9fff6314aa to your computer and use it in GitHub Desktop.
Neo4j 2.2 AJAX authentication example
$.ajaxSetup({
headers: {
"Authorization": 'Basic ' + window.btoa(username+":"+password)
}
});
$.ajax(txUrl(), {
type: "POST",
data: JSON.stringify({
statements: [{
statement: query,
parameters: params || {},
resultDataContents: ["row", "graph"]
}]
}),
dataType: "json",
contentType: "application/json;charset=UTF-8",
error: function(err) {
...
},
success: function(res) {
...
}
...
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment