If a HTTP resource is not able to handle a request with the given HTTP method, it should send an Allow header to list the allowed HTTP methods. Another possibility to get a response with an Allow header is to send a request with the OPTIONS method.

I'm wondering whether the Allow header should contain the OPTIONS method itself.

Example:

Allow: GET, PUT, DELETE, OPTIONS

or

Allow: GET, PUT, DELETE

What is correct?

有帮助吗?

解决方案

I don't see why not. The OPTIONS request method is used to request information about the communication options available for the requested URI. Some clients use OPTIONS to determine communication requirements and the server's capabilities without having to retrieve or perform an action on the requests resource.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top