Created
August 22, 2011 20:23
-
-
Save j-mcnally/1163428 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
<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