200 OK
2xx success
The request succeeded, and the response body holds the result.
200 is the default success status. What success means depends on the method: for GET the body is the resource, for POST it's the result of the action, for HEAD it's the same headers as GET without a body.
It's also the most misused status. An API that returns 200 with {"error": …} in the body breaks caches, monitoring and every client that checks response.ok.
| Class | 2xx Success |
|---|---|
| Retry? | Not applicable |
| Cacheable by default | Yes (heuristically, per RFC 9110) |
| Response body | Allowed |
| Defined in | RFC 9110 §15.3.1 — 200 OK |
HTTP/1.1 200 OK Content-Type: application/json
When you'll see it
- A GET returned the requested resource.
- A POST, PUT or PATCH completed and the response describes the outcome.
- A search or listing ran — even an empty list is a 200.
How to use it well
- Return 201 Created with a
Locationheader when a POST creates something. - Return 204 No Content when there's nothing useful to send back, such as after a DELETE.
- Never return 200 for a failure. Use 4xx for client errors and 5xx for server errors, so fetch(), caches and uptime checks see the truth.
Useful here: HTTP caching explained
Send a 200 from your server
res.status(200).json(result);
return Response.json(result, { status: 200 });return result, 200
w.WriteHeader(http.StatusOK)
return 200;
Check what a URL returns
Print just the status line from the command line, or check a whole list of URLs at once, with their response headers, in the HTTP Status Checker.
curl -sI https://example.com/your-path | head -n 1
Frequently asked questions
Should an empty search result be 200 or 404?
200 with an empty list. The search endpoint exists and worked; it just found nothing. 404 means nothing exists at that URL.
Is a 200 response cached?
A 200 to GET is cacheable by default: browsers and CDNs may store it heuristically unless Cache-Control says otherwise. Send explicit Cache-Control on dynamic responses.