Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I noticed that the Mozilla HTTP response codes documentation states that

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

However it doesn't make clear what response should actually be used. My best guess would be 204:

204 : No Content

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

Can anyone comment as to whether or not this is the correct code to be using to response to an OPTIONS request?

like image 283
Joshua Avatar asked Feb 03 '13 17:02

Joshua


1 Answers

I use 204 No Content because an OPTIONS response doesn't have any content.

like image 188
cd1 Avatar answered Sep 21 '22 15:09

cd1