+ Start a Discussion
Eyal Cohen 7Eyal Cohen 7 

HTTPS request from LWC


I am new to the enviornment.

I am trying to send https get request to a server from LWC but it doesn't work. I have added the remote server domaion to CORS & CSP trusted sites but nothing help.

WIll appericiate nay help here.

Access to XMLHttpRequest at 'http://.......' from origin 'https://ruby-enterprise-9373-dev-ed.lightning.force.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Hi Eyal,

Try to make API callouts from apex classes and return the response to the component. Hope this helps.

Post here if you've any further questions.

Happy Coding!!