View Javadoc

1   /*
2    * ====================================================================
3    * Licensed to the Apache Software Foundation (ASF) under one
4    * or more contributor license agreements.  See the NOTICE file
5    * distributed with this work for additional information
6    * regarding copyright ownership.  The ASF licenses this file
7    * to you under the Apache License, Version 2.0 (the
8    * "License"); you may not use this file except in compliance
9    * with the License.  You may obtain a copy of the License at
10   *
11   *   http://www.apache.org/licenses/LICENSE-2.0
12   *
13   * Unless required by applicable law or agreed to in writing,
14   * software distributed under the License is distributed on an
15   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16   * KIND, either express or implied.  See the License for the
17   * specific language governing permissions and limitations
18   * under the License.
19   * ====================================================================
20   *
21   * This software consists of voluntary contributions made by many
22   * individuals on behalf of the Apache Software Foundation.  For more
23   * information on the Apache Software Foundation, please see
24   * <http://www.apache.org/>.
25   *
26   */
27  
28  package org.apache.http;
29  
30  /**
31   * Constants enumerating the HTTP status codes.
32   * All status codes defined in RFC1945 (HTTP/1.0), RFC2616 (HTTP/1.1), and
33   * RFC2518 (WebDAV) are listed.
34   *
35   * @see StatusLine
36   *
37   * @since 4.0
38   */
39  public interface HttpStatus {
40  
41      // --- 1xx Informational ---
42  
43      /** {@code 100 Continue} (HTTP/1.1 - RFC 2616) */
44      public static final int SC_CONTINUE = 100;
45      /** {@code 101 Switching Protocols} (HTTP/1.1 - RFC 2616)*/
46      public static final int SC_SWITCHING_PROTOCOLS = 101;
47      /** {@code 102 Processing} (WebDAV - RFC 2518) */
48      public static final int SC_PROCESSING = 102;
49  
50      // --- 2xx Success ---
51  
52      /** {@code 200 OK} (HTTP/1.0 - RFC 1945) */
53      public static final int SC_OK = 200;
54      /** {@code 201 Created} (HTTP/1.0 - RFC 1945) */
55      public static final int SC_CREATED = 201;
56      /** {@code 202 Accepted} (HTTP/1.0 - RFC 1945) */
57      public static final int SC_ACCEPTED = 202;
58      /** {@code 203 Non Authoritative Information} (HTTP/1.1 - RFC 2616) */
59      public static final int SC_NON_AUTHORITATIVE_INFORMATION = 203;
60      /** {@code 204 No Content} (HTTP/1.0 - RFC 1945) */
61      public static final int SC_NO_CONTENT = 204;
62      /** {@code 205 Reset Content} (HTTP/1.1 - RFC 2616) */
63      public static final int SC_RESET_CONTENT = 205;
64      /** {@code 206 Partial Content} (HTTP/1.1 - RFC 2616) */
65      public static final int SC_PARTIAL_CONTENT = 206;
66      /**
67       * {@code 207 Multi-Status} (WebDAV - RFC 2518)
68       * or
69       * {@code 207 Partial Update OK} (HTTP/1.1 - draft-ietf-http-v11-spec-rev-01?)
70       */
71      public static final int SC_MULTI_STATUS = 207;
72  
73      // --- 3xx Redirection ---
74  
75      /** {@code 300 Mutliple Choices} (HTTP/1.1 - RFC 2616) */
76      public static final int SC_MULTIPLE_CHOICES = 300;
77      /** {@code 301 Moved Permanently} (HTTP/1.0 - RFC 1945) */
78      public static final int SC_MOVED_PERMANENTLY = 301;
79      /** {@code 302 Moved Temporarily} (Sometimes {@code Found}) (HTTP/1.0 - RFC 1945) */
80      public static final int SC_MOVED_TEMPORARILY = 302;
81      /** {@code 303 See Other} (HTTP/1.1 - RFC 2616) */
82      public static final int SC_SEE_OTHER = 303;
83      /** {@code 304 Not Modified} (HTTP/1.0 - RFC 1945) */
84      public static final int SC_NOT_MODIFIED = 304;
85      /** {@code 305 Use Proxy} (HTTP/1.1 - RFC 2616) */
86      public static final int SC_USE_PROXY = 305;
87      /** {@code 307 Temporary Redirect} (HTTP/1.1 - RFC 2616) */
88      public static final int SC_TEMPORARY_REDIRECT = 307;
89  
90      // --- 4xx Client Error ---
91  
92      /** {@code 400 Bad Request} (HTTP/1.1 - RFC 2616) */
93      public static final int SC_BAD_REQUEST = 400;
94      /** {@code 401 Unauthorized} (HTTP/1.0 - RFC 1945) */
95      public static final int SC_UNAUTHORIZED = 401;
96      /** {@code 402 Payment Required} (HTTP/1.1 - RFC 2616) */
97      public static final int SC_PAYMENT_REQUIRED = 402;
98      /** {@code 403 Forbidden} (HTTP/1.0 - RFC 1945) */
99      public static final int SC_FORBIDDEN = 403;
100     /** {@code 404 Not Found} (HTTP/1.0 - RFC 1945) */
101     public static final int SC_NOT_FOUND = 404;
102     /** {@code 405 Method Not Allowed} (HTTP/1.1 - RFC 2616) */
103     public static final int SC_METHOD_NOT_ALLOWED = 405;
104     /** {@code 406 Not Acceptable} (HTTP/1.1 - RFC 2616) */
105     public static final int SC_NOT_ACCEPTABLE = 406;
106     /** {@code 407 Proxy Authentication Required} (HTTP/1.1 - RFC 2616)*/
107     public static final int SC_PROXY_AUTHENTICATION_REQUIRED = 407;
108     /** {@code 408 Request Timeout} (HTTP/1.1 - RFC 2616) */
109     public static final int SC_REQUEST_TIMEOUT = 408;
110     /** {@code 409 Conflict} (HTTP/1.1 - RFC 2616) */
111     public static final int SC_CONFLICT = 409;
112     /** {@code 410 Gone} (HTTP/1.1 - RFC 2616) */
113     public static final int SC_GONE = 410;
114     /** {@code 411 Length Required} (HTTP/1.1 - RFC 2616) */
115     public static final int SC_LENGTH_REQUIRED = 411;
116     /** {@code 412 Precondition Failed} (HTTP/1.1 - RFC 2616) */
117     public static final int SC_PRECONDITION_FAILED = 412;
118     /** {@code 413 Request Entity Too Large} (HTTP/1.1 - RFC 2616) */
119     public static final int SC_REQUEST_TOO_LONG = 413;
120     /** {@code 414 Request-URI Too Long} (HTTP/1.1 - RFC 2616) */
121     public static final int SC_REQUEST_URI_TOO_LONG = 414;
122     /** {@code 415 Unsupported Media Type} (HTTP/1.1 - RFC 2616) */
123     public static final int SC_UNSUPPORTED_MEDIA_TYPE = 415;
124     /** {@code 416 Requested Range Not Satisfiable} (HTTP/1.1 - RFC 2616) */
125     public static final int SC_REQUESTED_RANGE_NOT_SATISFIABLE = 416;
126     /** {@code 417 Expectation Failed} (HTTP/1.1 - RFC 2616) */
127     public static final int SC_EXPECTATION_FAILED = 417;
128 
129     /**
130      * Static constant for a 418 error.
131      * {@code 418 Unprocessable Entity} (WebDAV drafts?)
132      * or {@code 418 Reauthentication Required} (HTTP/1.1 drafts?)
133      */
134     // not used
135     // public static final int SC_UNPROCESSABLE_ENTITY = 418;
136 
137     /**
138      * Static constant for a 419 error.
139      * {@code 419 Insufficient Space on Resource}
140      * (WebDAV - draft-ietf-webdav-protocol-05?)
141      * or {@code 419 Proxy Reauthentication Required}
142      * (HTTP/1.1 drafts?)
143      */
144     public static final int SC_INSUFFICIENT_SPACE_ON_RESOURCE = 419;
145     /**
146      * Static constant for a 420 error.
147      * {@code 420 Method Failure}
148      * (WebDAV - draft-ietf-webdav-protocol-05?)
149      */
150     public static final int SC_METHOD_FAILURE = 420;
151     /** {@code 422 Unprocessable Entity} (WebDAV - RFC 2518) */
152     public static final int SC_UNPROCESSABLE_ENTITY = 422;
153     /** {@code 423 Locked} (WebDAV - RFC 2518) */
154     public static final int SC_LOCKED = 423;
155     /** {@code 424 Failed Dependency} (WebDAV - RFC 2518) */
156     public static final int SC_FAILED_DEPENDENCY = 424;
157 
158     // --- 5xx Server Error ---
159 
160     /** {@code 500 Server Error} (HTTP/1.0 - RFC 1945) */
161     public static final int SC_INTERNAL_SERVER_ERROR = 500;
162     /** {@code 501 Not Implemented} (HTTP/1.0 - RFC 1945) */
163     public static final int SC_NOT_IMPLEMENTED = 501;
164     /** {@code 502 Bad Gateway} (HTTP/1.0 - RFC 1945) */
165     public static final int SC_BAD_GATEWAY = 502;
166     /** {@code 503 Service Unavailable} (HTTP/1.0 - RFC 1945) */
167     public static final int SC_SERVICE_UNAVAILABLE = 503;
168     /** {@code 504 Gateway Timeout} (HTTP/1.1 - RFC 2616) */
169     public static final int SC_GATEWAY_TIMEOUT = 504;
170     /** {@code 505 HTTP Version Not Supported} (HTTP/1.1 - RFC 2616) */
171     public static final int SC_HTTP_VERSION_NOT_SUPPORTED = 505;
172 
173     /** {@code 507 Insufficient Storage} (WebDAV - RFC 2518) */
174     public static final int SC_INSUFFICIENT_STORAGE = 507;
175 
176 }