How To Send Basic Auth Using Fetch

[Solved] How To Send Basic Auth Using Fetch | Basic - Code Explorer | yomemimo.com
Question : how to send basic auth using fetch

Answered by : ever-dev

fetch(url, {	...options,	headers: {	'Authorization': 'Basic ' + btoa(`${username}:${password}`) }
})
.then(response => response.json())
.then(json => console.log(json));

Source : | Last Update : Sun, 18 Oct 20

Answers related to how to send basic auth using fetch

Code Explorer Popular Question For Basic