My API looks something like this https://customerlink.org/api/data?email="
I have no problem using it with postman, I just need to encode the query string(email), as ‘@’ is not a valid character.
I used a website to encode the email and it worked with no problem. I used Postman and add the Basic Auth credentials
however I am confused on how to add the email part and how to encode it from my react app.
var api_url = "https://customerlink.org/api/data?email="
var email = "testemail@gmail.com"
var username = 'username';
var password = 'password';
var basicAuth = 'Basic ' + btoa(username + ':' + password);
axios.post(api_url + email, {}, {
headers: { 'Authorization': + basicAuth }
}).then(function(response) {
console.log('Authenticated');
}).catch(function(error) {
console.log('Error on Authentication');
});