Created
October 30, 2012 22:10
-
-
Save waldyrfelix/3983411 to your computer and use it in GitHub Desktop.
Requisição HTTP Basic Authorization com JS
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
$.ajax({ | |
url: "http://localhost:36210/api/values", | |
type: "GET", | |
dataType: "json", | |
beforeSend: function(xhr){ | |
xhr.setRequestHeader('Authorization', 'Basic d2FsZHlyOjEyMw=='); | |
}, | |
success: function(data) { | |
$(data).each(function(index, value){ | |
console.log(index + ') '+ value); | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment