OPTIONS in PHP REST API

The HTTP OPTIONS method returns (at least) the HTTP methods that the server supports for a specific URL. Per example, if you have a resource (/user) where you can create, retrieve and retrieve headers (but not delete or update), OPTIONS should return the following response header:

Allow: GET,HEAD,POST

If you can delete the resource as well, it would be:

Allow: GET,HEAD,POST,DELETE

You get the idea.


See section 9.2 http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html

Tags:

Php

Rest