Yesterday the api was fine but today it gives me cors error ?
What is your host name.
Only localhost is allowed
localhost:3000 :( zeevy please help me i have a case study from a company. I have to use your api and complete the project in 2 days but im getting error now.
Access to fetch at 'https://gorest.co.in/v2/users' from origin 'http://localhost:3000' 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.
access-control-allow-origin: http://localhost:3000 is allowed
are you using wrong url "https://gorest.co.in/v2/users" instead of "https://gorest.co.in/public/v2/users"
curl -X GET -H "Origin: http://localhost:3000" -I https://gorest.co.in/public/v2/users
date: Mon, 20 Mar 2023 14:15:05 GMT
content-type: application/json; charset=utf-8
access-control-allow-methods: GET, POST, DELETE, PUT, OPTIONS, PATCH, HEAD
access-control-expose-headers: x-links-current, x-links-next, x-links-previous, x-pagination-limit, x-pagination-page, x-pagination-pages, x-pagination-total, x-ratelimit-limit, x-ratelimit-remaining, x-ratelimit-reset
cache-control: max-age=0, private, must-revalidate
alt-svc: h3=":443"; ma=86400, h3-29=":443"; ma=86400
Yes, that was the problem. Thank you very much and I apologize for taking up your time.