0
When I call the following URL: https://script.google.com/macros/s/AKfycbxk616n8wjgGeHZIc3Hm66Kcv4ZtWKZJQnEKLsxZC9LpoDK8mQZ/exec directly in the browser or in POSTMAN I get JSON correctly, but when I try to call the same link via GET in Angular, I get the error: "Failed to load https://script.googleusercontent.com/macros/echo...: Response to preflight request doesn’t pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested Resource. Origin 'http://localhost:4200' is therefore not allowed access."
I’m using a normal Httpclient:
getTabela() {
return this.http.get<TabelaEstatistica[]>('https://script.google.com/macros/s/AKfycbxk616n8wjgGeHZIc3Hm66Kcv4ZtWKZJQnEKLsxZC9LpoDK8mQZ/exec');
}
Does anyone know what I should do to receive JSON in my application?
Cors problems should be solved in the backend.
– Eduardo Vargas
Yes it is that the backend in this case is a google webservice.
– Murilo Góes de Almeida
vc can create a proxy service that calls this service and transfers the data to your application. Or see some configuration in this google service.
– Eduardo Vargas