View Javadoc
1   /*
2    * Copyright (c) 2002-2025 Gargoyle Software Inc.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * https://www.apache.org/licenses/LICENSE-2.0
8    *
9    * Unless required by applicable law or agreed to in writing, software
10   * distributed under the License is distributed on an "AS IS" BASIS,
11   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12   * See the License for the specific language governing permissions and
13   * limitations under the License.
14   */
15  package org.htmlunit.http;
16  
17  /**
18   * Http Status Codes.
19   *
20   * @see <a href="https://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml">
21   *          IANA HTTP Status Code Registry</a>
22   *
23   * @author Ronald Brill
24   */
25  public final class HttpStatus {
26  
27      // ---- 100 ----
28  
29      /** Continue / 100. */
30      public static final int CONTINUE_100 = 100;
31  
32      /** Switching Protocols / 101. */
33      public static final int SWITCHING_PROTOCOLS_101 = 101;
34  
35      /** Processing / 102. */
36      public static final int PROCESSING_102 = 102;
37  
38      // ---- 200 ----
39  
40      /** OK / 200. */
41      public static final int OK_200 = 200;
42      /** OK / 200. */
43      public static final String OK_200_MSG = "OK";
44  
45      /** Created / 201. */
46      public static final int CREATED_201 = 201;
47  
48      /** Accepted / 202. */
49      public static final int ACCEPTED_202 = 202;
50  
51      /** Non Authoritative Information / 203. */
52      public static final int NON_AUTHORITATIVE_INFORMATION_203 = 203;
53  
54      /** No Content / 204. */
55      public static final int NO_CONTENT_204 = 204;
56      /** No Content / 204. */
57      public static final String NO_CONTENT_204_MSG = "No Content";
58  
59      /** Reset Content / 205. */
60      public static final int RESET_CONTENT_205 = 205;
61  
62      /** Partial Content / 206. */
63      public static final int PARTIAL_CONTENT_206 = 206;
64  
65      /** Multi Status / 207. */
66      public static final int MULTI_STATUS_207 = 207;
67  
68      // ---- 300 ----
69  
70      /** Multiple Choices / 300. */
71      public static final int MULTIPLE_CHOICES_300 = 300;
72  
73      /** Moved Permanently / 301. */
74      public static final int MOVED_PERMANENTLY_301 = 301;
75  
76      /** Found / 302. */
77      public static final int FOUND_302 = 302;
78  
79      /** See Other / 303. */
80      public static final int SEE_OTHER_303 = 303;
81  
82      /** Not Modified / 304. */
83      public static final int NOT_MODIFIED_304 = 304;
84  
85      /** Use Proxy / 305. */
86      public static final int USE_PROXY_305 = 305;
87  
88      /** Temporary Redirect / 307. */
89      public static final int TEMPORARY_REDIRECT_307 = 307;
90  
91      /** Permanent Redirect / 308. */
92      public static final int PERMANENT_REDIRECT_308 = 308;
93  
94      // ---- 400 ----
95  
96      /** Bad Request / 400. */
97      public static final int BAD_REQUEST_400 = 400;
98  
99      /** Unauthorized / 401. */
100     public static final int UNAUTHORIZED_401 = 401;
101 
102     /** Payment Required / 402. */
103     public static final int PAYMENT_REQUIRED_402 = 402;
104 
105     /** Forbidden / 403. */
106     public static final int FORBIDDEN_403 = 403;
107 
108     /** Not Found / 404. */
109     public static final int NOT_FOUND_404 = 404;
110     /** Not Found / 404. */
111     public static final String NOT_FOUND_404_MSG = "Not Found";
112 
113     /** Method Not Allowed / 405. */
114     public static final int METHOD_NOT_ALLOWED_405 = 405;
115 
116     /** Not Acceptable / 406. */
117     public static final int NOT_ACCEPTABLE_406 = 406;
118 
119     /** Proxy Authentication Required / 407. */
120     public static final int PROXY_AUTHENTICATION_REQUIRED_407 = 407;
121 
122     /** Request Timeout / 408. */
123     public static final int REQUEST_TIMEOUT_408 = 408;
124 
125     /** Conflict / 409. */
126     public static final int CONFLICT_409 = 409;
127 
128     /** Gone / 410. */
129     public static final int GONE_410 = 410;
130 
131     /** Length Required / 411. */
132     public static final int LENGTH_REQUIRED_411 = 411;
133 
134     /** Precondition Failed / 412. */
135     public static final int PRECONDITION_FAILED_412 = 412;
136 
137     /** Payload Too Large / 413. */
138     public static final int PAYLOAD_TOO_LARGE_413 = 413;
139 
140     /** URI Too Long / 414. */
141     public static final int URI_TOO_LONG_414 = 414;
142 
143     /** Unsupported Media Type / 415. */
144     public static final int UNSUPPORTED_MEDIA_TYPE_415 = 415;
145 
146     /** Range Not Satisfiable / 416. */
147     public static final int RANGE_NOT_SATISFIABLE_416 = 416;
148 
149     /** Expectation Failed / 417. */
150     public static final int EXPECTATION_FAILED_417 = 417;
151 
152     /** Im A Teapot / 418. */
153     public static final int IM_A_TEAPOT_418 = 418;
154 
155     /** Enhance Your Calm / 420. */
156     public static final int ENHANCE_YOUR_CALM_420 = 420;
157 
158     /** Misdirected Request / 421. */
159     public static final int MISDIRECTED_REQUEST_421 = 421;
160 
161     /** Unprocessable Entity / 422. */
162     public static final int UNPROCESSABLE_ENTITY_422 = 422;
163 
164     /** Locked / 423. */
165     public static final int LOCKED_423 = 423;
166 
167     /** Failed Dependency / 424. */
168     public static final int FAILED_DEPENDENCY_424 = 424;
169 
170     /** Update Required / 426. */
171     public static final int UPGRADE_REQUIRED_426 = 426;
172 
173     /** Precondition Required / 428. */
174     public static final int PRECONDITION_REQUIRED_428 = 428;
175 
176     /** Too Many Requests / 429. */
177     public static final int TOO_MANY_REQUESTS_429 = 429;
178 
179     /** Request Header Fields Too Large / 431. */
180     public static final int REQUEST_HEADER_FIELDS_TOO_LARGE_431 = 431;
181 
182     /** Bad Unavailable For Legal Reasons / 451. */
183     public static final int UNAVAILABLE_FOR_LEGAL_REASONS_451 = 451;
184 
185     // ---- 500 ----
186 
187     /** Internal Server Error / 500. */
188     public static final int INTERNAL_SERVER_ERROR_500 = 500;
189 
190     /** Not Implemented / 501. */
191     public static final int NOT_IMPLEMENTED_501 = 501;
192 
193     /** Bad Gateway / 502. */
194     public static final int BAD_GATEWAY_502 = 502;
195 
196     /** Service Unavailable / 503. */
197     public static final int SERVICE_UNAVAILABLE_503 = 503;
198 
199     /** Gateway Timeout / 504. */
200     public static final int GATEWAY_TIMEOUT_504 = 504;
201 
202     /** Http Version Not Supported / 505. */
203     public static final int HTTP_VERSION_NOT_SUPPORTED_505 = 505;
204 
205     /** Insufficient Storage / 507. */
206     public static final int INSUFFICIENT_STORAGE_507 = 507;
207 
208     /** Loop Detected / 508. */
209     public static final int LOOP_DETECTED_508 = 508;
210 
211     /** Not Extended / 510. */
212     public static final int NOT_EXTENDED_510 = 510;
213 
214     /** Network Authentication Required / 511. */
215     public static final int NETWORK_AUTHENTICATION_REQUIRED_511 = 511;
216 
217     private HttpStatus() {
218         // util class
219     }
220 }