What HTTP response code should be used for an OPTION request?

I noticed that the Mozilla HTTP response code documentation claims that

The PUT, DELETE, and OPTIONS methods can never result in a 200 OK Response.

However, it is not clear which answer should be used. My best guess would be 204:

204: No content

There is no content to send this request, but headers may be useful. A user agent can update its cached headers for this resource with new ones.

Can anyone comment on whether this code is really used to respond to an OPTIONS request?

+4
source share
4 answers

Well, in this case, the Mozilla documentation is clearly incorrect.

+3
source

I use 204 No Content because the OPTIONS response does not contain any content.

+3
source

(updated, by the way) RLC for HTTP 1.1 clearly indicate 200 OK is an acceptable answer for all 3 methods, see section 6.3.1 of RFC 7231 .

+2
source

RFC2616 clearly mentions answer 200 and the requirements for answer 200: http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html

+1
source

All Articles