Advertisement
EntropyStarRover

kinvey auth

Nov 16th, 2019
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const username="entropy";
  2. const password="fuckoff";
  3.  
  4.  
  5. let auth=`Basic ${btoa(`${username}:${password}`)}`
  6.  
  7. let  headers={
  8.     'Content-type': 'application/json',
  9.     "Authorization": auth    
  10. }
  11.  
  12. loadButton.addEventListener("click", async function(){
  13.     let response = await fetch("https://baas.kinvey.com/appdata/kid_rkzic96iS/books",{
  14.     method:"GET",
  15.     headers: headers});
  16.     let books = await response.json();
  17.     console.log(books)
  18. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement