How to send Basic Auth with axios

I’m trying to implement the following code, but something is not working. Here is the code: var session_url=”http://api_address/api/session_endpoint”; var username=”user”; var password = ‘password’; var credentials = btoa(username + ‘:’ + password); var basicAuth=”Basic ” + credentials; axios.post(session_url, { headers: { ‘Authorization’: + basicAuth } }).then(function(response) { console.log(‘Authenticated’); }).catch(function(error) { console.log(‘Error on Authentication’); }); It’s … Read more