200 OK

The HTTP 200 OK status code indicates the request succeeded. The meaning of success and the accompanying message body vary based on the HTTP method used.

The response is cacheable by default. To override this behavior, the response needs to include the appropriate Cache-Control headers.

Usage

A 200 OK response includes a message body except in response to a HEAD request, and the server is free to set the body length to zero. A zero-length body is expected on some servers when processing a PUT, DELETE, or OPTIONS request.

When the server has no content to return, the 204 status code is more appropriate. For requests creating a new resource, such as a POST creating content, a 201 status code is returned instead.

GET

A GET response contains the message body of the requested resource.

Request

GET /document.pdf HTTP/1.1
Host: www.example.re

Response

HTTP/1.1 200 OK
Content-Type: application/pdf
Content-Length: 10000

<message body contains the requested PDF document>

A HEAD response contains the same headers as a GET response, with no message body.

Request

HEAD / HTTP/1.1
Host: www.example.re

Response

HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8

POST

A POST response typically contains information about the result of the action or progress status.

Request

POST /api/data HTTP/1.1
Host: www.example.re
Content-Type: application/json
Content-Length: 24

{"name":"example entry"}

Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 18

{"success":"true"}

PUT

A PUT response typically contains information about the result of the action or progress status.

Request

PUT /api/data/1 HTTP/1.1
Host: www.example.re
Content-Type: application/json
Content-Length: 24

{"name":"updated entry"}

Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 18

{"success":"true"}

TRACE

A TRACE response contains the request message as the server received the request.

Request

TRACE / HTTP/1.1
Host: www.example.re

Response

HTTP/1.1 200 OK
Content-Type: message/http
Content-Length: 38

TRACE / HTTP/1.1
Host: www.example.re

DELETE

A DELETE response includes a status indication of the completed action.

Request

DELETE /api/data/1 HTTP/1.1
Host: www.example.re

Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 18

{"deleted":"true"}

OPTIONS

An OPTIONS response includes the Allow header listing the HTTP methods the server accepts. Optionally, the server specifies further details in the message body.

Request

OPTIONS / HTTP/1.1
Host: www.example.re

Response

HTTP/1.1 200 OK
Allow: GET,HEAD,PUT,OPTIONS
Content-Type: text/plain;charset=UTF-8

Code references

.NET

HttpStatusCode.OK

Rust

http::StatusCode::OK

Rails

:ok

Go

http.StatusOK

Symfony

Response::HTTP_OK

Python3.5+

http.HTTPStatus.OK

Java

java.net.HttpURLConnection.HTTP_OK

Apache HttpComponents Core

org.apache.hc.core5.http.HttpStatus.SC_OK

Angular

@angular/common/http/HttpStatusCode.Ok

See also

Last updated: August 11, 2026