Skip to content

Instantly share code, notes, and snippets.

@j-mcnally
Created August 22, 2011 20:23
Show Gist options
  • Save j-mcnally/1163428 to your computer and use it in GitHub Desktop.
Save j-mcnally/1163428 to your computer and use it in GitHub Desktop.
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script>
$(document).ready(function() {
$.ajax("http://revolve.amazon/session/create", {
type: "POST",
dataType: "json",
processData: false,
headers: {
"Accept": "application/json",
"Content-Type": "application/json"
},
data: JSON.stringify({user: {username: "mikeb", password: "ThePassword1"}}),
error: function(e) {
console.log(e);
},
success: function(data) {
console.log(data);
getProjects(data.sessionId);
}
});
});
var getProjects = function(session) {
console.log('project');
$.ajax("http://revolve.amazon/projects", {
type: "GET",
dataType: "json",
processData: false,
headers: {
"Accept": "application/json",
"Content-Type": "application/json",
"Sessionid": session
},
success: function(data) {
console.log(data);
}
});
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment