CORS Method Rejected — Allow-Methods

Why 'Method PUT is not allowed by Access-Control-Allow-Methods' happens in preflight — and how to fix the server's method allowlist.

Scenario presets

Request — the browser (page) side

Method

Content-Type

Custom header

Access-Control-Request-Headers: content-type

Response — headers the server sends

Access-Control-Allow-Origin

Access-Control-Allow-Methods

Access-Control-Allow-Headers

Headers the request needs + common values — click to toggle

Browser processing steps

→

Page issues a fetch request

•

Not a simple request — an OPTIONS preflight is required

→

OPTIONS preflight request sent

OPTIONS /data HTTP/1.1
Origin: https://myapp.example.com
Access-Control-Request-Method: PUT
Access-Control-Request-Headers: content-type
←

Server's preflight response arrives

HTTP/1.1 204 No Content
Access-Control-Allow-Origin: https://myapp.example.com
Access-Control-Allow-Methods: GET, POST
Access-Control-Allow-Headers: content-type
✓

Allow-Origin matches the origin — pass

✗

Request method is missing from Allow-MethodsPUT

✓

All request headers are in Allow-Headers — pass

—

No credentials — check skipped

✗

Browser blocks the response and rejects the fetch

Browser console

✕ Access to fetch at 'https://api.example.com/data' from origin 'https://myapp.example.com' has been blocked by CORS policy: Method content-type is not allowed by Access-Control-Allow-Methods in preflight response.

(index):1

Change any value and the steps below recompute instantly. Try the 'credentials + *' scenario to see why the wildcard fails.

PUT, DELETE or PATCH makes your request preflight-worthy, and if Access-Control-Allow-Methods doesn't list that method, the browser blocks with 'Method X is not allowed' — the real request is never sent, even though the endpoint exists.

Common mistakes: listing only GET/POST in Allow-Methods, or the server/proxy rejecting OPTIONS itself with 404/405, which kills the preflight before it starts.

Toggle PUT off and on in this simulator's Allow-Methods — watch the failure stop at the preflight stage with no actual request line. That's the signature of a browser-side block: 'server is fine but nothing in the logs'. CORS Simulator

Frequently asked questions

Can I use * in Allow-Methods?
It works for non-credentialed requests in modern browsers, but is ignored for credentialed ones — list the methods explicitly to be safe.
What if the server rejects OPTIONS with 405?
The preflight itself fails and the real request never happens. Allow OPTIONS through and return 204 with the CORS headers.

Other scenarios