My Products
Help
Anonymous
Not applicable

CORS errors making requests to API

by Anonymous

Hi, I'm trying to request resources from the API using Javascript fetch but are being stopped by CORS errors. If i try to fetch using mode: 'no-cors' I only get a 401 error.

Any ideas on how to solve this?

If my understanding is correct, the API responses should have included an 

Access-Control-Allow-Origin: <mysite>

header, but this does not seem to be the case. Any ides on how to work around this problem? 

1 REPLY 1
Anonymous
Not applicable

by Anonymous (Updated ‎25-04-2021 05:23 ( )

I managed to work around this by doing the api fetch directly from my node.js instance, and then fetching from node.js in the browser javascript, but this seems like an unnecessary detour.