Consume this JSON because I am encountering an error

Asked

Viewed 61 times

0

I have this JSON: API JSON

But when I consume it I get this error

VM414 index.html:1 Access to fetch at 
 'https://thaleshenrique38.000webhostapp.com/products.json' 
 from origin 'http://127.0.0.1:5500' has been blocked by CORS policy: 
    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.

What should I do, from what I understand I am without permission as I can give myself this permission to consume the API.

1 answer

1

  • 1

    In addition, if you don’t want to use a proxy you can set the headers to allow CORS calls. In the Sampaio Leal response you can track possible solutions according to what you use

Browser other questions tagged

You are not signed in. Login or sign up in order to post.