An OPTIONS request in a REST API asks the server which HTTP methods and headers are allowed for a given resource, and it is the standard way a client discovers what it can do before it acts. The server answers with an Allow header listing methods such as GET, POST, PUT, PATCH and DELETE, and often with Access-Control-Allow-Methods when cross-origin requests are involved. You do not need to send a body with OPTIONS; the response carries the information.
What an OPTIONS Response Actually Tells You
The response is a description of the resource's contract, not its content. The most useful part is the Allow header, which names the methods the endpoint accepts. A read-only collection might return Allow: GET, HEAD, OPTIONS, while a writable item endpoint might return Allow: GET, PUT, PATCH, DELETE, OPTIONS. If a method is missing from that list, sending it will typically produce a 405 Method Not Allowed, so the header saves you a failed request.
OPTIONS can also report which headers a request may include. In cross-origin browser requests, the preflight response carries Access-Control-Allow-Methods, Access-Control-Allow-Headers and Access-Control-Max-Age. That last value tells the browser how many seconds it may cache the preflight result, so the same check is not repeated for every call.
One caution: OPTIONS describes the endpoint, not your permission to use it. A method can appear in Allow and still return 401 Unauthorized or 403 Forbidden for your credentials. Treat the header as a map of what exists, then confirm access with an actual request.
Why Browsers Send OPTIONS Before Cross-Origin Calls
When a page on one origin calls an API on another, the browser may send a preflight OPTIONS request first. It does this when the request uses a method other than GET, HEAD or POST, or when it sends custom headers such as Authorization or Content-Type set to application/json. The browser is asking the server, in effect, whether the real request is acceptable.
The server replies with the CORS headers, and the browser decides whether to send the actual request. If the preflight fails, the real call never leaves the browser, and you see a CORS error in the console rather than a response from the API. This is why a working request in a command-line tool can fail in a browser: the tool skips the preflight, the browser does not.
Simple requests, such as a GET with no custom headers, skip the preflight and go straight to the server. That distinction explains why some endpoints seem to work cross-origin while others do not.
Reading an OPTIONS Response Step by Step
- Send the request to the exact resource URL, not the API root, because Allow can differ per endpoint.
- Read the status code first. A 200 or 204 means the endpoint answered; a 404 means the URL is wrong; a 405 suggests OPTIONS itself is disabled.
- Check the Allow header and note every method listed. Compare it with what you planned to send.
- Look for Access-Control-Allow-Methods and Access-Control-Allow-Headers if the call comes from a browser on another origin.
- Note Access-Control-Max-Age so you know how long the browser may reuse the preflight result.
- Send one real request for the method you need and confirm the response, rather than assuming access from the header alone.
If Allow is absent, the server may not support OPTIONS on that route, or a proxy may be stripping the header. Check with the API documentation before concluding the method is unsupported.
When OPTIONS Fails or Returns Nothing Useful
A 405 on the OPTIONS request itself usually means the route exists but the server has not enabled OPTIONS for it. Some frameworks require you to register the method explicitly. A 404 means the path is wrong or the route is not mounted where you think.
If the response arrives but Allow is empty, a gateway or reverse proxy may be removing headers. Test the same URL directly against the application server to see whether the header survives. If it does, the proxy configuration needs attention.
For browser calls, a CORS error often traces to a missing Access-Control-Allow-Origin or a method not listed in Access-Control-Allow-Methods. The fix belongs on the server, not in the client code, so report the preflight response to whoever maintains the API.
Some APIs disable OPTIONS entirely for security or simplicity. In that case, rely on the published documentation and on the status codes returned by real requests to learn what is allowed.
OPTIONS Compared With HEAD and GET
OPTIONS reports what methods and headers a resource accepts; HEAD returns the same headers as GET but without the body, which is useful for checking existence, content type and length. GET returns the representation itself. None of the three changes the resource, so all are considered safe methods.
A practical rule: use HEAD to ask whether something exists and how large it is, use OPTIONS to ask what you may do with it, and use GET to fetch it. When you are unsure which method an endpoint supports, OPTIONS is the cheapest question to ask first.
Does every REST API support OPTIONS?
No. It is widely supported because browsers rely on it for cross-origin requests, but some servers disable it or handle it only at certain routes. If OPTIONS is unavailable, the API documentation and the status codes from real requests are your guide.
Can I send a body with an OPTIONS request?
You can, but servers generally ignore it. The method is defined to describe communication options for the resource, so the response headers carry the answer, not a request payload.
Why does my browser send OPTIONS but my script does not?
Browsers apply the same-origin policy and preflight cross-origin requests that use non-simple methods or custom headers. Command-line tools and server-side scripts are not bound by that policy, so they call the endpoint directly.
Is a 200 response to OPTIONS a guarantee my request will work?
No. It confirms the endpoint answered and lists what it accepts, but authentication, rate limits and validation can still reject your actual request. Send the real call and read its status code.