Note that there are some explanatory texts on larger screens.

plurals
  1. POAjax PUT Request »Request Method:OPTIONS«
    primarykey
    data
    text
    <p>I'd like to send a PUT Request to my API. When Server and Client are on one machine, everything works just fine. When the API is on a remote Server then I get a 404 Error. (But the URL is right and the API is working as well; I checked that with PostMan (a REST Client App for Chrome)). The Request Method is shown in DevTools as:</p> <pre><code>Request Method:OPTIONS </code></pre> <p>After searching the web I found out that it has something to to with </p> <pre><code>Access-Control-Allow-Methods:GET, POST, PUT, DELETE Access-Control-Allow-Origin:* </code></pre> <p>so I changed the API Response to the above example.</p> <p>Here is the complete output of the headers:</p> <pre><code>Request URL:http://example.org/api Request Method:OPTIONS Status Code:404 Not Found **Request Headers** Accept:*/* Accept-Encoding:gzip,deflate,sdch Accept-Language:en-US,en;q=0.8,de;q=0.6 Access-Control-Request-Headers:accept, content-type Access-Control-Request-Method:PUT Cache-Control:no-cache Connection:keep-alive Host:example.org Origin:http://localhost Pragma:no-cache Referer:http://localhost/svpoffline/index.html User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/31.0.1650.63 Chrome/31.0.1650.63 Safari/537.36 **Response Headers** Access-Control-Allow-Headers:X-Custom-Header Access-Control-Allow-Methods:GET, POST, PUT, DELETE Access-Control-Allow-Origin:* Connection:Keep-Alive Content-Encoding:gzip Content-Length:368 Content-Type:text/html Date:Wed, 25 Dec 2013 23:47:35 GMT Keep-Alive:timeout=1, max=100 Server:Apache Vary:Accept-Encoding X-Powered-By:PHP/5.4.21-nmm1 </code></pre>
    singulars
    1. This table or related slice is empty.
    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. This table or related slice is empty.
    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