Go REST
D

CORS Error

Dex over 3 years ago 3808 views 2 replies

Hi team,

Not able to do a POST request to the below endpoint/API. Kindly advise may be there is a missing CORS setting.
https://gorest.co.in/public-api/users

Access to fetch at 'https://gorest.co.in/public-api/users' from origin 'https://mydomain.dummyinternet.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

2 replies
Z
zeevy over 3 years ago

you need to test your code from your localhost. browsers will not allow cross origin requests.

I allowed localhost

Z
zeevy over 3 years ago

Please check now it may work for your domain also

Your reply

Markdown supported