showing results for - "jquery ajax get with authentication"
Nahil
04 Apr 2017
1var username="username_here";
2var password="password_here";
3$.ajax({
4  type: "GET",
5  url: "myapi.php",
6  dataType: 'json',
7  headers: {
8    "Authorization": "Basic " + btoa(username + ":" + password)
9  },
10  success: function (result){
11      console.log(result)
12  }
13});
Bruno
25 Feb 2017
1var username="username_here";
2var password="password_here";
3$.ajax({
4  type: "GET",
5  url: "myapi.php",
6  dataType: 'json',
7  headers: {
8    "Authorization": "Basic " + btoa(username + ":" + password)
9  },
10  success: function (result){
11      console.log(result)
12  }
13});
queries leading to this page
in ajax api call user name and pasword askingpost request jquery authjquery rest api call with authenticationjquery ajax www authenticateajax added header with passwordjquery ajax authentication didnt worksending authorization header in ajaxauthorization header in jquery ajaxjquery ajax authorization headerajax authenticationajax get header authorizationjquery pass authorization headerhow to use basic authentication in ajax callajax get jqeury with header authbasic authentication jquerybasic auth header ajaxjquery ajax get set auth headerajax use authorizationbasic authorization header jquerybasic auth js ajaxheader basic auth jqueryjquery add authorization headersending basic aut in post ajaxajax jquery basic authajax send username and passwordhow to pass authorization header in ajaxajax basic authentication doemoajax username password 24 ajax jquery passing authenticationjavascript basic authorization headerset authorization header in ajax requestjquery ajax send authorization headerajax basic authenticationhtml basic auth ajaxajax call basic authenticationxhr setrequestheader 28 22authorization 22 2c 22basic 22 2b btoa 28make post api call with authentication in jqueryjquery rest api basic authenticationjquery ajax get with authenticationajax header authjquery get http request with basic authhttp get basic authentication jqueryjquery ajax basic authentication examplejquery ajax get authorization headerajax authorization headerbasic authentication header javascripthow to send basic authentication in header ajaxajax basic auth jquerybasic authentication ajaxajax call with basic authenticationajax basic authset authorization header ajax jqueryjquery http basic auth ajaxjquery ajax use authentication headerauthentication ajaxbasic authentication in ajax callbase64 for the user name and password ajaxjquery ajax authorization tokenjquery post set authorization headerjquery get authorization headerjquery ajax send authorizationjavascropt basic auth headerajax with basic authbasic auth jquery ajaxajax authorizationbasic auth in ajax codejquery get with authorization headerjquery get with authorizationajax jquery basic authentication calljquery ajax get with authentication