Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • developer.mozilla.org/en-US/docs/Web/HTTP/CORS Commented Dec 3, 2018 at 17:26
  • Thanx @Majenko but that is too general and doesn't address the esp8266 scenario. Commented Dec 3, 2018 at 17:46
  • 1
    add the CORS header to every response, not only for 'preflight' OPTIONS request. @Majenko, only resources ncluded from other server need CORS headers Commented Dec 3, 2018 at 18:27
  • 1
    you don't need the OPTIONS support, just add the ACAO header to the response Commented Dec 3, 2018 at 20:12
  • 1
    @Juraj and @ dandavis I combined both your comments and it now works! I removed the OPTIONS part and put server.sendHeader("Access-Control-Allow-Origin","*"); in the response. Thanx! If either want to put it in the form of an answer I will be happy to accept it. Commented Dec 3, 2018 at 23:01