I am trying to implement an axios request using their official documentation.
Here is my code snippet:
const REFERRAL_API_URL= "https://referrals.gen.com"
export function createReferral() {
axios({
data: {},
headers: {
'Content-Type': 'application/json',
ApiKey: ReferralApiKey,
},
method: 'post',
url: `${REFERRAL_API_URL}/api/ReferralMasters`,
withCredentials: true,
})
.then(function (response) {
console.log(response)
})
.catch(function (error) {
console.log(error)
})
}
However, when I execute the function, I encounter a 404 error message:
NOT FOUND https://localhost:3000/referrals.gen.com/api/ReferralMasters
I'm confused as to why localhost:3000
is included in the URL path. Any ideas on what could be causing this issue?