Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Javascript fetch api

fetch('https://example.com/path', 
      {method:'GET', 
       headers: {
         'Authorization': 'Basic ' + btoa('login:password') //use btoa in js and Base64.encode in node
       }
      })
.then(response => response.json())
.then(json => console.log(json));
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Javascript #fetch #api
ADD COMMENT
Topic
Name
7+8 =