Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You've run into the <a href="http://www.w3.org/TR/cors/" rel="nofollow">Cross-Origin Resource Sharing</a> (CORS) specification.</p> <p>Note the <code>OPTIONS</code> in your output. <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.2" rel="nofollow">The OPTIONS HTTP Verb</a> is used by the browser to query the web server <em>about</em> the URL, not to <code>GET</code> its contents or <code>POST</code> data to it.</p> <p>Your server doesn't respond with the correct header data on a CORS request, so your browser assumes it has no rights to access the data, and refuses to GET or POST to the URL.</p> <p>If you truly want to let any website in the world run that AJAX request, you can do something similar to the following:</p> <pre><code>function handleOptions(request, response) { response.writeHead(200, { "Access-Control-Allow-Origin": "*", "Access-Control-Allow-Method": "POST, GET, OPTIONS", "Access-Control-Allow-Headers": request.headers["access-control-request-headers"] }); response.end(); } function server(request, response) { if(request.method == "POST") { handlePost(request, response); } else if(request.method == "OPTIONS") { handleOptions(request, response); } else { handleOther(response); } } https.createServer(sslObj, server).listen(9001); </code></pre> <p>You can fill in the details and whether you should handle <code>GET</code> separately, and so on (<code>handleOther</code> should return an appropriate error code for each request method you don't support).</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload