Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>This OPTIONS request is the CORS preflight request. It is a request that is sent to the server before the actual request in order to ask permissions to make the request. The custom Content-Type is in fact triggering the preflight. According to the CORS spec (<a href="http://www.w3.org/TR/cors/" rel="noreferrer">http://www.w3.org/TR/cors/</a>), any Content-Type <em>other</em> than application/x-www-form-urlencoded, multipart/form-data, or text/plain triggers the preflight.</p> <p>If you have no control over the remote server, then you'll need to either ask them to support CORS preflight, or try some other option such as JSON-P.</p> <p>If you do have control over the remote server, you can change it to handle preflights. In order to handle a preflight request, you should send the following headers in the response to the OPTIONS request:</p> <pre><code>Access-Control-Allow-Origin: * Access-Control-Allow-Methods: POST Access-Control-Allow-Headers: Content-Type </code></pre> <p>The response should be an HTTP 200. The <code>Access-Control-Allow-Methods</code> response header can either echo the value of the <code>Access-Control-Request-Method</code>, or it can just be <code>GET, POST, PUT, DELETE</code> to support all methods. The <code>Access-Control-Allow-Headers</code> response header should echo the values in the <code>Access-Control-Request-Headers</code> request header. </p> <p>Once the browser receives those headers, it will make the actual request. You can learn more about CORS preflight requests here:</p> <p><a href="http://www.html5rocks.com/en/tutorials/cors/" rel="noreferrer">http://www.html5rocks.com/en/tutorials/cors/</a></p>
 

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