Learn CORSErrorsTesterFrameworksQuizSearch

Simple Requests and Preflight: When Does CORS Send OPTIONS?

By Ankit Jain · Updated

Predict preflight from the method and request headers. Credentials alone do not trigger it; JSON and Authorization commonly do.

A cross-origin request can be sent directly or checked with a preflight first. Credential inclusion is a separate setting, so a request can be both simple and credentialed.

Common preflight decisions

RequestNormally needs preflight?Reason
GET with no added headersNoSafelisted method and headers
GET with credentials: include onlyNoCredentials alone do not trigger it
POST with text/plainNo, if other constraints holdSafelisted content type
POST with application/jsonYesContent type is not safelisted
GET with AuthorizationYesHeader is not safelisted
PUT without added headersYesMethod is not safelisted

These examples assume ordinary fetch requests, no cached preflight permission, and no other trigger such as a streaming request body.

What makes a request simple?

The method is GET, HEAD, or POST. Author-controlled headers must meet CORS safelist constraints. Common safelisted names include Accept, Accept-Language, Content-Language, Content-Type, and a single byte-range Range header. Values have length and syntax restrictions. Content-Type’s MIME essence must be application/x-www-form-urlencoded, multipart/form-data, or text/plain.

XMLHttpRequest upload listeners and streaming fetch bodies introduce additional constraints. If Network shows OPTIONS unexpectedly, inspect the actual outgoing headers and request API rather than guessing from the method.

What happens next?

A simple request goes directly to the API. The browser then checks response permission. A required preflight asks whether the method and headers are allowed before sending the actual request. A successful OPTIONS response does not grant the actual response permanent permission: it still needs its own CORS headers.

Do not relabel JSON as text/plain solely to avoid preflight unless that is the endpoint’s genuine protocol. Handle OPTIONS correctly instead.

Simple GET

This GET has no added headers. fetch uses its default credentials setting, so it sends no cross-origin cookies.

Page: https://app.example.com
Server API: https://api.example.com

Loading diagram. You can read the request and response details below while it loads.

On a small screen, scroll sideways to see the full diagram.

Read request and response details
  1. JavaScript → Browser: Ask for a response

    const response = await fetch('https://api.example.com/message');
  2. Browser check: No preflight needed

    This GET meets the simple-request conditions. The browser sends it directly.

  3. Browser → Server API: Actual request

    GET /message
    Origin: https://app.example.com
  4. Server API → Browser: Actual response

    200 OK
    Access-Control-Allow-Origin: *
    Content-Type: application/json
    
    {"message":"hello"}
  5. Browser check: Response access allowed

    The wildcard allows JavaScript to read this response because the request does not use credentials: include.

  6. Browser → JavaScript: A readable Response

    response.type   // "cors"
    response.status // 200
    response.ok     // true
    await response.json()
    // {"message":"hello"}

The browser checks response permission even when there is no OPTIONS request. If that permission is missing, the GET still reaches the server, but fetch rejects and JavaScript cannot read the response.

Only the relevant headers and bodies are shown. Browsers add other headers. Your code reads the response body with response.json() or another body-reading method.

Next: follow a complete preflight exchange.

References