You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/content/docs/support/troubleshooting/http-status-codes/2xx-success.mdx
+56-36Lines changed: 56 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,73 +5,93 @@ title: 2xx Success
5
5
6
6
---
7
7
8
-
## Overview
8
+
2xx status codes indicate success, meaning that the client's request was received, understood, and accepted by the server.
9
9
10
-
**2xx** codes indicate success — meaning that a client's action was received, understood, and accepted.
10
+
## 200 OK
11
11
12
-
***
12
+
A 200 response indicates that the request has succeeded.
13
13
14
-
##200 - OK
14
+
### Common use cases
15
15
16
-
A **200** response means the request has succeeded.
16
+
A 200 response is commonly used in the following scenarios:
17
17
18
-
The response payload will vary based on the request method:
18
+
- GET requests: Returns requested resources such as webpages, images, or API data, along with relevant headers.
19
+
- HEAD requests: Retrieves only headers corresponding to the requested resource, such as metadata. For example, file size or last modified date.
20
+
- POST requests: Confirms successful processing of submitted data, such as form submissions, often with details about the result in the response body.
19
21
20
-
***GET**: Headers and data corresponding to the requested resource
21
-
***HEAD**: Only headers corresponding the requested resource
22
-
***POST**: Status of or results obtained from the action
22
+
A 200 response should ideally include a payload but is not required. Occasionally, an origin server may return a 200 response with zero content length. However, following RFC standards, a 204 response is recommended in such cases (except for the CONNECT method).
23
23
24
-
A 200 response **should** always have a payload, but is not required. Occasionally, an origin server may generate a 200 with a zero length. To adhere to RFC standards, the server should generate a 204 code (exception CONNECT).
24
+
### Cloudflare-specific information
25
25
26
-
200 responses are cacheable by default for proxy servers and browsers.If not specified by Cloudflare [cache controls](https://support.cloudflare.com/hc/en-us/articles/202775670), [static resources](/cache/concepts/default-cache-behavior/)with this response will cache default for 2 hours at our edge.
26
+
By default, 200 responses are cacheable by proxy servers and browsers.If specific [cache controls](/cache/concepts/customize-cache/) are not defined, [static resources](/cache/concepts/default-cache-behavior/)with a 200 response are cached for two hours at Cloudflare's edge.
27
27
28
-
***
28
+
## 201 Created
29
29
30
-
##201 - Created
30
+
A 201 response indicates the successful creation of one or more new resources. The server typically includes the location of the newly created resource in either the `Location` header or the request URI.
31
31
32
-
A **201** response means that the request was successful and one or more new resources were created.
32
+
### Common use cases
33
33
34
-
Typically, you will find the new resource's location in the server's response (either the **Location** header or the request's URI).
34
+
Creating a new resourcein response to a POST request. For example, creating a new user, article, or record.
35
35
36
-
Refer to [RFC 7231](https://tools.ietf.org/html/rfc7231#section-7.2) for a discussion on validator header fields in a 201 response, such as **ETag** and **Last-Modified.**
36
+
### Cloudlare-specific information
37
37
38
-
***
38
+
Cloudflare forwards 201 responses without modification.
39
39
40
-
## 203 - Non-authoritative information
40
+
For further information, refer to [RFC 7231](https://tools.ietf.org/html/rfc7231#section-7.2) for more details about validator headers, like **ETag** and **Last-Modified** in a 201 response.
41
41
42
-
A **203** response means that the request was successful but the response did not come directly from the origin server. The response was instead delivered by a proxy or intermediate server.
42
+
## 203 Non-authoritative information
43
43
44
-
Servers use this response to tell a client that this resource has been cached at a proxy.
44
+
A 203 response indicates that the request was successful, but the response did not come directly from the origin server. The response was instead delivered by a proxy or intermediate server.
45
45
46
-
Cloudflare does not cache 203 responses. For details about Cloudflare handles 203 responses, refer to [HTTP request headers](/fundamentals/reference/http-request-headers/).
46
+
### Common use cases
47
47
48
-
***
48
+
Servers use this response to tell a client that the resource was cached by a proxy server.
49
49
50
-
##204 - No content
50
+
### Cloudlare-specific information
51
51
52
-
A **204** response means that the request was successful but there is no content to return.
52
+
Cloudflare does not cache 203 responses. For details about how Cloudflare handles 203 responses, refer to [HTTP request headers](/fundamentals/reference/http-request-headers/).
53
53
54
-
Commonly, servers provide this response when a document editor "saves" an action to the origin server. It lets the client know the save was successful.
54
+
## 204 No content
55
55
56
-
204 responses never contain payloads and Cloudflare does not cache these responses.
56
+
A 204 response indicates that the request was successfully processed, but there is no content to return in the response.
57
57
58
-
***
58
+
### Common use cases
59
59
60
-
## 205 - Reset content
60
+
This response is often used by servers to indicate that a document editor's save action to the origin server was completed successfully.
61
61
62
-
A **205** response tells the client to return to its previous state after a request. This response occurs after someone submits a form or other data and lets the client know to refresh the page or allow another submission.
62
+
### Cloudflare-specific information
63
63
64
-
205 responses should never return a payload.
64
+
204 responses never contain payloads, as specified by the HTTP standard, and Cloudflare does not cache these responses.
65
65
66
-
***
66
+
## 205 Reset content
67
67
68
-
## 206 - Partial content
68
+
A 205 response tells the client to return to its previous state after a request.
69
69
70
-
A **206** response means that the request was partially successful. Use this response to decrease latency when clients are processing larger files that might require split or interrupted downloads.
70
+
### Common use cases
71
71
72
-
This request should also return either:
72
+
This response occurs after a user submits a form or other data and they want to tell the client to refresh the page or allow a new submission.
73
73
74
-
* A partial payload that includes the **Content-Range** header that indicates the range and the data present in that range
75
-
* A multipart payload that **does not** include the **Content-Range** header on the top-level HTTP response, but includes **Content-Type** and **Content-Range** headers on each individual part
74
+
### Cloudflare-specific information
75
+
76
+
205 responses must not contain any payloads and Cloudflare does not cache these responses.
77
+
78
+
## 206 Partial content
79
+
80
+
A 206 response means that the request was partially successful, often used for serving large files in smaller chunks.
81
+
82
+
### Common use cases
83
+
84
+
This response is often used to decrease latency when clients are processing larger files that might require split or interrupted downloads. For instance, for streaming video or serving file ranges for progressive loading.
85
+
86
+
A 206 response includes either:
87
+
88
+
- Partial payload that contains a `Content-Range` header specifying the requested range and the data provided in the response.
89
+
- Multipart payload that omits the `Content-Range` header at the top level but includes `Content-Type` and `Content-Range` headers for each part of the multipart response body.
76
90
77
91
For more details, refer to [RFC 7233 Section 4.1](https://tools.ietf.org/html/rfc7233#page-10).
92
+
93
+
### Cloudflare-specific information
94
+
95
+
Cloudflare handles 206 responses for range requests, but caching behavior may vary depending on the file type and origin settings.
0 commit comments