I'm calling an API with a fetch, when I make the call I get the following:
Failed to load link : Response to preflight request does not pass access control check: No 'Access-Control-Allow- Origin 'header is present on the requested resource. Origin ' link ' is therefore not allowed access. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
In the documentation they gave me two data: API Application *** Account: ********
I have this script for the api call:
const direccionUrl = 'http://mppromocionales.com/ws_products.php',
parametros = {
method: 'GET',
mode: 'cors',
redirect: 'follow',
headers: new Headers({
'Content-Type': 'application/json'
})
},
request = new Request(direccionUrl, parametros)
I can not access and I do not know where I could add the data they give me in order to have access.