# HTTP 200 OK — Status Code Meaning & Examples

> 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
- Defined in: [RFC 9110 §15.3.1 — 200 OK](https://www.rfc-editor.org/rfc/rfc9110.html#section-15.3.1)

## Example response

```http
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

1. Return 201 Created with a `Location` header when a POST creates something.
2. Return 204 No Content when there's nothing useful to send back, such as after a DELETE.
3. 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.

## Send a 200 from your server

### Express

```
res.status(200).json(result);
```

### Next.js route handler

```
return Response.json(result, { status: 200 });
```

### Flask

```
return result, 200
```

### Go net/http

```
w.WriteHeader(http.StatusOK)
```

### nginx

```
return 200;
```

## FAQ

### 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.

## Related status codes

- [201 Created](https://www.devkult.com/http/201.md)
- [204 No Content](https://www.devkult.com/http/204.md)
- [304 Not Modified](https://www.devkult.com/http/304.md)

Open the interactive page: https://www.devkult.com/http/200