Closed gowthamjohn closed 4 years ago
As stated in the error message, the fetch request is blocked due to CORS which is unrelated to the LWC framework. Please refer to the Google Maps API documentation and the different thread on Stack Overflow for more details.
AIzaSyDEDeoI-XwIyBOyWY0snI8MG_yIIFBcJ7I
Remove this key This Cost you many money!
Iam trying to do a callout with GET operation
Added in CORS and Remote site settings
Working in apex class and post man, but not working in Lightning web component
Here is the code
`HttpRequest req = new HttpRequest(); Http http = new Http(); req.setMethod('GET');
String url = 'https://maps.googleapis.com/maps/api/distancematrix/json' / ... /;
req.setEndPoint(url); HTTPResponse resp = http.send(req); system.debug('resp '+resp.getbody());`