HTTP OPTIONS Method

Information about the HTTP OPTIONS method.

HTTP OPTIONS

Get the communication options for the resource, or * for the entire server. Typically this is used to get allowed HTTP headers for CORS.

Request Body

Data in a request body should not be sent. While not forbidden, the behaviour is undetermined and different servers may react differently.

Response Body

A response body will be returned with a successful response.

Cache

The response cannot be cached.

Safe

The request should not alter the state of the server - it should be read-only. This is not enforced by the server, and a common mistake is for a safe request to cause a change.

Idempotent

The request should not cause any side-effects on the server and it should be possible to issue the same request several times with the server being left in the same state.

This is not enforced by the server and a common mistake is for an idempotent request to change the server state.

Example

OPTIONS / HTTP/1.1
OPTIONS /a-url/?search=cat HTTP/1.1
OPTIONS * HTTP/1.1

Reference

https://tools.ietf.org/html/rfc7231#section-4.3.7