mirror of
https://github.com/rmaake1/httpstatuses.git
synced 2024-09-15 14:02:37 +02:00
62df9e637c
* Add Python status constants * Add Python 2, Python 3+, Python 3.5+ status constants
37 lines
1.7 KiB
Markdown
37 lines
1.7 KiB
Markdown
---
|
|
set: 2
|
|
code: 200
|
|
title: OK
|
|
references:
|
|
"Rails HTTP Status Symbol": ":ok"
|
|
"Go HTTP Status Constant": "http.StatusOK"
|
|
"Symfony HTTP Status Constant": "Response::HTTP_OK"
|
|
"Python2 HTTP Status Constant": "httplib.OK"
|
|
"Python3+ HTTP Status Constant": "http.client.OK"
|
|
"Python3.5+ HTTP Status Constant": "http.HTTPStatus.OK"
|
|
---
|
|
|
|
The request has succeeded.
|
|
|
|
The payload sent in a 200 response depends on the request method. For the methods defined by this specification, the intended meaning of the payload can be summarized as:
|
|
|
|
* `GET` a representation of the target resource
|
|
* `HEAD` the same representation as `GET`, but without the representation data
|
|
* `POST` a representation of the status of, or results obtained from, the action;
|
|
* `PUT` `DELETE` a representation of the status of the action;
|
|
* `OPTIONS` a representation of the communications options;
|
|
* `TRACE` a representation of the request message as received by the end server.
|
|
|
|
Aside from responses to CONNECT, a 200 response 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 Content](/204) instead. For CONNECT, no payload is allowed because the successful result is a tunnel, which begins immediately after the 200 response header section.
|
|
|
|
A 200 response is cacheable by default; i.e., unless otherwise indicated by the method definition or explicit cache controls<sup>[1](#ref-1)</sup>.
|
|
|
|
---
|
|
|
|
* <span id="ref-1"><sup>1</sup> Calculating Heuristic Freshness
|
|
[RFC7234 Section 4.2.2][2]</span>
|
|
* Source: [RFC7231 Section 6.3.1][1]
|
|
|
|
[1]: <http://tools.ietf.org/html/rfc7231#section-6.3.1>
|
|
[2]: <http://tools.ietf.org/html/rfc7234#section-4.2.2>
|