OK
ActiveHTTP 200 OK indicates the request has succeeded. The meaning varies by method: GET returns the resource, POST returns the result of the action. Defined in RFC 9110 §15.3.1. The most common HTTP response code.
Description
The 200 OK status code indicates that the request has succeeded. The content returned with the response depends on the method used:
- GET: The target resource's representation is sent in the response body. - HEAD: The same headers as GET but no body. - POST: A representation of the action's result or the created resource. - PUT/DELETE: A representation of the action's status.
A 200 response is cacheable by default unless otherwise indicated by method definition or cache controls.
Examples
GET /api/users/42 HTTP/1.1
Host: api.example.com
Accept: application/jsonHTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 85
{"id": 42, "name": "Alice", "email": "alice@example.com", "role": "admin"}Edge Cases
- •A 200 response to a DELETE does not mean the resource is gone — only that the action was processed.
- •Returning 200 for POST when 201 Created would be more appropriate is a common API design mistake.
- •A 200 with an empty body is valid but may confuse clients expecting content.
When You'll See This
- →Successfully fetching a resource (GET)
- →API returning query results
- →Form submission processed successfully
- →Health check endpoints
Implementation References
| Language | Constant |
|---|---|
| Go | http.StatusOK |
| Rust | http::StatusCode::OK |
| Python | http.HTTPStatus.OK |
| Node.js | http.STATUS_CODES[200] |
| .NET | HttpStatusCode.OK |
| Java | HttpURLConnection.HTTP_OK |
History
Present since the earliest HTTP specification (HTTP/0.9, 1991). Has remained unchanged in meaning through every revision of the protocol.
Related Status Codes
Related Headers
FAQ
What does HTTP 200 OK mean?
HTTP 200 OK means the request was successful. The response body contains the requested data or the result of the action.
When should I use 200 vs 201 vs 204?
Use 200 for successful GET or general success. Use 201 when a new resource was created (POST). Use 204 when the action succeeded but there's no body to return.