Access-Control-Allow-Methods: Sent in preflight responses (200 OPTIONS) listing which HTTP methods are allowed cross-origin. Access-Control-Allow-Methods is another preflight answer. It tells the browser which HTTP methods are allowed for cross-origin requests to this URL, for example GET, POST, PUT, DELETE. Simple GET and POST requests with standard headers do not need a preflight. As soon as you send PUT, PATCH or DELETE from another origin, the browser checks first. If the method is not listed, the request never reaches your application code.
Frequently asked questions about Access-Control-Allow-Methods
What should you keep in mind with Access-Control-Allow-Methods?
A common confusion is that the API works fine in Postman or curl but fails in the browser. Those tools do not enforce CORS, so they never send a preflight. If an endpoint works there and not in your front end, look at the OPTIONS response in the browser's network tab and check whether this header includes the method you are using.
What does an example of Access-Control-Allow-Methods look like?
Access-Control-Allow-Methods: GET, POST, PUT, DELETE
Use when reviewing or setting HTTP response headers for a web app or API - security headers (Content-Security-Policy, Strict-Transport-Security, X-Frame-Options, X-Content-Type-Options, Referrer-Policy, Permissions-Policy), CORS headers, caching headers (Cache-Control, ETag, Last-Modified, Vary) and cookies (Set-Cookie flags). Also use when a security scan reports missing headers.
Master REST and GraphQL API design principles to build intuitive, scalable, and maintainable APIs that delight developers. Use when designing new APIs, reviewing API specifications, or establishing API design standards.
'Expert-level browser automation, debugging, and performance analysis using Chrome DevTools MCP. Use for interacting with web pages, capturing screenshots, analyzing network traffic, and profiling performance.'