Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

jquery ajax get with authentication

var username="username_here";
var password="password_here";
$.ajax({
  type: "GET",
  url: "myapi.php",
  dataType: 'json',
  headers: {
    "Authorization": "Basic " + btoa(username + ":" + password)
  },
  success: function (result){
      console.log(result)
  }
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: swiper.js cdn 
Javascript :: disable all element in div angular 12 
Javascript :: js parse string to html elemen 
Javascript :: npm warn config global --global --local are deprecated 
Javascript :: node get all files in folder 
Javascript :: how to import lodash in react 
Javascript :: js remove falsey values from array 
Javascript :: javacript is checkbox checked 
Javascript :: run a function after delay javascript 
Javascript :: javascript urlencode json 
Javascript :: clear terminal node js 
Javascript :: javascript confirm yes no 
Javascript :: store data in localstorage javascript 
Javascript :: react native navigation transparent header 
Javascript :: javascript audio stop 
Javascript :: regex yyyy-mm-dd 
Javascript :: react simbu 
Javascript :: drupal 8 link render array 
Javascript :: select random element js array 
Javascript :: javascript get weekday name 
Javascript :: acces store from vue console javascript 
Javascript :: react native animated sticker 
Javascript :: How to use font awewsome in react app 
Javascript :: javascript array includes another array 
Javascript :: jquery detect when a checkbox is checked 
Javascript :: how to change background image url in javascript 
Javascript :: react native flatlist horizontal scroll 
Javascript :: npm remove dev dependencies from node_modules 
Javascript :: javascript remove parentheses 
Javascript :: nodejs command line arguments 
ADD CONTENT
Topic
Content
Source link
Name
8+1 =