OPTIONS
The HTTP method that asks a server which communication options a resource supports, used by browsers for CORS preflight requests.
In more detail
OPTIONS is safe. Browsers send it automatically before a cross-origin request that is not simple, naming the method and headers they intend to use; the server answers with the Access-Control headers that grant or withhold permission.
Example
In the browser: An OPTIONS request has no side effects; servers answer it with headers such as Allow or Access-Control-Allow-Methods.Related terms
- preflight request — An automatic OPTIONS request a browser sends before a cross-origin request that is not simple, to ask the server for permission first.
- CORS — The browser rule set that decides whether web page code from one origin may read a response from a different origin.
- Allow header — The response header listing the methods a resource accepts, required on every 405 Method Not Allowed answer.
- HTTP method — The verb at the start of a web request that says what the client wants, such as GET to read or POST to create.
Taught in
- Cookies And CORS — Modern API Architecture: REST, GraphQL & gRPC
- Same-Origin Policy, CORS Preflight, Credentials And Headers — Frontend Architecture & Web Platform