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