Created
February 17, 2012 06:34
-
-
Save smgt/1851290 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
// Create a new object | |
ajax = new XMLHttpRequest(); | |
// Try to open a API resource that won't return a 200 or 201 | |
ajax.open("GET", "https://api.flattr.com/rest/v2/user", false); | |
ajax.send(); | |
// The response | |
ajax.responseText; | |
// "{"error":"unauthorized","error_description":"You are unauthorized to access the resource","error_uri":"http:\/\/developers.flattr.net\/api\/"}" | |
ajax.status; | |
// 401 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment