Cors error

Hi all,
I have a seemingly illogical problem and I can’t find a solution.
We created this Req of this type:
https://maps.googleapis.com/maps/api/distancematrix/json?destinations=calea manastur 2 cluj-napoca&origins=VIVO PND cluj-napoca&departure_time=now&key=(Google APIkey)
and I get this error CORS.


Interested that I have another Req (on the same page) of the same type that works ok:
https://maps.googleapis.com/maps/api/geocode/json?address=rasinari 2 cluj-napoca&key=(Google APIkey)
Can anyone help me fix this CORS error?
my app id:
D3E675A8-5EAB-4152-A0B7-206D1942B8A6

Hello @Mihaltan_Horea, we will be happy to assist you.

How can we reproduce the issue?

Hi Sergey
in my app /Dispecer/pages/ComandaNoua
in comandaForm
submitEvent
I created, among other things, two requests to googleapis.
the first req works perfectly, but on the second req I receive CORS error.
I can’t explain why I get this error

I have found the following page:


is it correct, what date should I provide? Because the button OK is always disabled

in the ‘Cauta strada’ field enter ‘rasinari’, select it and chek ‘Plata OP’

looks like this should helps you json - How to use CORS to implement JavaScript Google Places API request - Stack Overflow

I see that the error no longer occurs. And from the link sent I don’t really understand much :). Anyway, it seems to work, thank you very much.

actually, I was able to reproduce the issue somehow, and I google it and found the possible issue with google on stackoverflow json - How to use CORS to implement JavaScript Google Places API request - Stack Overflow

Hey @sergey-kukurudzyak I am having the same issue with a distance matrix api, can you help me understand what you put in the header (I assume) to have the api request accepted?

Hello @Joel_Maclean1

This topic has already been solved. Please create a new topic and describe the problem.

Regards,
Inna

All good I found an alternate,
tks