I am currently developing a dashboard that uses the Mention API. However, I am having difficulty due to the CORS policy.
If the toolbar is open in a Chrome browser or in another browser with a strict CORS policy, each time they request OPTIONS options, but they are not supported by the API.
So every time I do something like:
this.mentionAPI = axios.create({
baseURL: 'https://web.mention.net/api/accounts/my-account-id',
headers: {
'Authorization': 'Bearer my-access-token',
}
});
this.mentionAPI.get('/alerts')
.then((response) => {
console.log(response);
})
.catch((response) => {
console.log(response);
});
I get a response with a status of 405 Method Not Allowed. This suggests that OPTIONS requests are not processed by the API at all.
, , . , , . , , , , , JavaScript .
. , , API ?