Skip to content

Instantly share code, notes, and snippets.

Created April 19, 2013 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/5420639 to your computer and use it in GitHub Desktop.
Save anonymous/5420639 to your computer and use it in GitHub Desktop.
<html>
<head>
<title>aosidjoasijdf</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
function make_base_auth(user, password) {
var tok = user + ':' + password;
var hash = btoa(tok);
return "Basic " + hash;
}
$(document).ready(function() {
var options = {};
options.url = "http://localhost?uri=192.168.168.196:9870/jolokia/";
options.beforeSend = function (xhr) {
xhr.setRequestHeader('Authorization', make_base_auth("test", "test"));
};
$.ajax(options);
});
</script>
</head>
<body>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment