Hello forum:
I am attempting to create a JS api call that will return the sales tax percentage to a web page when a zip code is sent with the API call
I am using example code from rapidapi.com.
My javascript editor gives me 3 errors but I cannot determine what is causing them.
Maybe someone here can help me?
This is the example code:
const options = {
method: 'GET',
headers: {
'X-RapidAPI-Key': 'MY API Key goes here',
'X-RapidAPI-Host': 'sales-tax-rates1.p.rapidapi.com'
}
};
fetch('https://sales-tax-rates1.p.rapidapi.com/v/api/?zip=98661', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
Cheers,
Larry
I am attempting to create a JS api call that will return the sales tax percentage to a web page when a zip code is sent with the API call
I am using example code from rapidapi.com.
My javascript editor gives me 3 errors but I cannot determine what is causing them.
Maybe someone here can help me?
This is the example code:
const options = {
method: 'GET',
headers: {
'X-RapidAPI-Key': 'MY API Key goes here',
'X-RapidAPI-Host': 'sales-tax-rates1.p.rapidapi.com'
}
};
fetch('https://sales-tax-rates1.p.rapidapi.com/v/api/?zip=98661', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
Cheers,
Larry
Comment