Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var wusername = "xxxx";
- var wpass = "xxxx";
- $.ajax({
- username: wusername,
- password: wpass,
- url: 'http://92.39.131.114:40999/test_connection/',
- type: 'POST',
- crossDomain: true,
- contentType: "text/plain; charset=utf-8",
- data: { test: "blablabla" },
- beforeSend: function(xhr){
- xhr.setRequestHeader("Authorization",
- "Basic " + btoa(wusername + ":" + wpass));
- },
- success: function(result) {
- console.log("YES!!!");
- },
- error: function(){
- console.log("error");
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement