Can an HTTP OPTIONS request return a 204 or should it always return 200?
问题 According to http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.2 the only response ever mentioned regarding an HTTP OPTIONS request is a 200. However, there seem to be cases such as when the content-length is 0 that a 204 would be more appropriate. Is it appropriate for an HTTP OPTIONS request to return a 204? 回答1: Yes, it can return 204. Or 400. Or 404. There is no general restriction as to what status codes a method can return. Also note that it's time to stop looking at RFC 2616.