0

I'm trying to make a website that triggers a webhook to trigger an Alexa Routine using https://trigger.esp8266-server.de/. The request goes through fine and it works fine, but in the console, it's logging out a CORS error. The server is still responding with 200 OK though.

This is my console after the request is sent:

Access to XMLHttpRequest at 'https://trigger.esp8266-server.de/api/?id=REDACTED&hash=REDACTED' from origin 'REDACTED' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.Understand this error
jquery-3.7.1.js:9940 
        
        
       GET https://trigger.esp8266-server.de/api/?id=REDACTED&hash=REDACTED net::ERR_FAILED 200 (OK)

This is my JavaScript code:

$.ajax({
  url: "https://trigger.esp8266-server.de/api/?id=REDACTED&hash=REDACTED",
  method: "GET",
}).done(() => {
  
});

Any and all help is appreciated! Thanks!

I tried adding the allow origin header with the *, but it didn't work.

1
  • 1
    Browsers will not allow what you're trying to do. The only way around the issue is to create your own server-side proxy, or else maybe try to use a public one.
    – Pointy
    Commented Jun 16 at 23:31

0

Browse other questions tagged or ask your own question.