OPTIONS method

The OPTIONS HTTP method is used for cross-origin resrouce sharing (CORS) to preflight the request. Normally CORS request do not need a preflight. A request is preflighted when:

  • It makes a request other than a POST or GET. Also, if POST is used to send request data with a Content-Type other than application/x-www-form-urlencoded, multipart/form-data, or text/plain, e.g. if the POST request sends a JSON payload to the server using application/json or text/json, then the request is preflighted.
  • It sets custom headers in the request.