Created
March 12, 2015 15:25
-
-
Save ralfbecher/61488a276e9fff6314aa to your computer and use it in GitHub Desktop.
Neo4j 2.2 AJAX authentication example
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
$.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