Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR BASIC

how to send basic auth using fetch

fetch(url, {
	...options, 
	headers: {
    	'Authorization': 'Basic ' + btoa(`${username}:${password}`)
    }
})
.then(response => response.json())
.then(json => console.log(json));
 
PREVIOUS NEXT
Tagged: #send #basic #auth #fetch
ADD COMMENT
Topic
Name
2+9 =