Advertisement
vladislavkopilov

test

Jul 15th, 2015
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var wusername = "xxxx";
  2. var wpass = "xxxx";
  3. $.ajax({
  4.         username: wusername,
  5.         password: wpass,
  6.         url: 'http://92.39.131.114:40999/test_connection/',
  7.         type: 'POST',
  8.         crossDomain: true,
  9.         contentType: "text/plain; charset=utf-8",
  10.         data: { test: "blablabla" },
  11.         beforeSend: function(xhr){
  12.             xhr.setRequestHeader("Authorization",
  13.                 "Basic " + btoa(wusername + ":" + wpass));
  14.         },
  15.         success: function(result) {
  16.             console.log("YES!!!");
  17.         },
  18.         error: function(){
  19.             console.log("error");
  20.         }
  21.     });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement