Takeaways
- Aside from responses to
CONNECT, a200 OKresponse always has a payload, though an origin server may generate a payload body of zero length. - If no payload is desired, an origin server ought to send
204 No Contentinstead. - For
CONNECT, no payload is allowed because the successful result is a tunnel, which begins immediately after the200 OKresponse header section.
A 200 response is cacheable by default; unless otherwise indicated by the method definition or explicit cache controls.
Information
The HTTP 200 OK success status response code indicates that the request has succeeded. A 200 response is cacheable by default.
The meaning of a success depends on the HTTP request method:
GET: The resource has been fetched and is transmitted in the message body.HEAD: The representation headers are included in the response without any message bodyPOST: The resource describing the result of the action is transmitted in the message bodyTRACE: The message body contains the request message as received by the server.
The successful result of a PUT or a DELETE is often not a 200 OK but a 204 No Content (or a 201 Created when the resource is uploaded for the first time).