001/*
002 * ====================================================================
003 * Licensed to the Apache Software Foundation (ASF) under one
004 * or more contributor license agreements.  See the NOTICE file
005 * distributed with this work for additional information
006 * regarding copyright ownership.  The ASF licenses this file
007 * to you under the Apache License, Version 2.0 (the
008 * "License"); you may not use this file except in compliance
009 * with the License.  You may obtain a copy of the License at
010 *
011 *   http://www.apache.org/licenses/LICENSE-2.0
012 *
013 * Unless required by applicable law or agreed to in writing,
014 * software distributed under the License is distributed on an
015 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
016 * KIND, either express or implied.  See the License for the
017 * specific language governing permissions and limitations
018 * under the License.
019 * ====================================================================
020 *
021 * This software consists of voluntary contributions made by many
022 * individuals on behalf of the Apache Software Foundation.  For more
023 * information on the Apache Software Foundation, please see
024 * <http://www.apache.org/>.
025 *
026 */
027
028package org.apache.http;
029
030/**
031 * Constants enumerating the HTTP status codes.
032 * All status codes defined in RFC1945 (HTTP/1.0), RFC2616 (HTTP/1.1), and
033 * RFC2518 (WebDAV) are listed.
034 *
035 * @see StatusLine
036 * @see <a href="https://tools.ietf.org/html/rfc1945">RFC1945 (HTTP/1.0)</a>
037 * @see <a href="https://tools.ietf.org/html/rfc2616">RFC2616 (HTTP/1.1)</a>
038 * @see <a href="https://tools.ietf.org/html/rfc2518">RFC2518 (WebDAV)</a>
039 * @since 4.0
040 */
041public interface HttpStatus {
042
043    // --- 1xx Informational ---
044
045    /** {@code 100 Continue} (HTTP/1.1 - RFC 2616) */
046    public static final int SC_CONTINUE = 100;
047    /** {@code 101 Switching Protocols} (HTTP/1.1 - RFC 2616)*/
048    public static final int SC_SWITCHING_PROTOCOLS = 101;
049    /** {@code 102 Processing} (WebDAV - RFC 2518) */
050    public static final int SC_PROCESSING = 102;
051
052    // --- 2xx Success ---
053
054    /** {@code 200 OK} (HTTP/1.0 - RFC 1945) */
055    public static final int SC_OK = 200;
056    /** {@code 201 Created} (HTTP/1.0 - RFC 1945) */
057    public static final int SC_CREATED = 201;
058    /** {@code 202 Accepted} (HTTP/1.0 - RFC 1945) */
059    public static final int SC_ACCEPTED = 202;
060    /** {@code 203 Non Authoritative Information} (HTTP/1.1 - RFC 2616) */
061    public static final int SC_NON_AUTHORITATIVE_INFORMATION = 203;
062    /** {@code 204 No Content} (HTTP/1.0 - RFC 1945) */
063    public static final int SC_NO_CONTENT = 204;
064    /** {@code 205 Reset Content} (HTTP/1.1 - RFC 2616) */
065    public static final int SC_RESET_CONTENT = 205;
066    /** {@code 206 Partial Content} (HTTP/1.1 - RFC 2616) */
067    public static final int SC_PARTIAL_CONTENT = 206;
068    /**
069     * {@code 207 Multi-Status} (WebDAV - RFC 2518)
070     * or
071     * {@code 207 Partial Update OK} (HTTP/1.1 - draft-ietf-http-v11-spec-rev-01?)
072     */
073    public static final int SC_MULTI_STATUS = 207;
074
075    // --- 3xx Redirection ---
076
077    /** {@code 300 Mutliple Choices} (HTTP/1.1 - RFC 2616) */
078    public static final int SC_MULTIPLE_CHOICES = 300;
079    /** {@code 301 Moved Permanently} (HTTP/1.0 - RFC 1945) */
080    public static final int SC_MOVED_PERMANENTLY = 301;
081    /** {@code 302 Moved Temporarily} (Sometimes {@code Found}) (HTTP/1.0 - RFC 1945) */
082    public static final int SC_MOVED_TEMPORARILY = 302;
083    /** {@code 303 See Other} (HTTP/1.1 - RFC 2616) */
084    public static final int SC_SEE_OTHER = 303;
085    /** {@code 304 Not Modified} (HTTP/1.0 - RFC 1945) */
086    public static final int SC_NOT_MODIFIED = 304;
087    /** {@code 305 Use Proxy} (HTTP/1.1 - RFC 2616) */
088    public static final int SC_USE_PROXY = 305;
089    /** {@code 307 Temporary Redirect} (HTTP/1.1 - RFC 2616) */
090    public static final int SC_TEMPORARY_REDIRECT = 307;
091
092    // --- 4xx Client Error ---
093
094    /** {@code 400 Bad Request} (HTTP/1.1 - RFC 2616) */
095    public static final int SC_BAD_REQUEST = 400;
096    /** {@code 401 Unauthorized} (HTTP/1.0 - RFC 1945) */
097    public static final int SC_UNAUTHORIZED = 401;
098    /** {@code 402 Payment Required} (HTTP/1.1 - RFC 2616) */
099    public static final int SC_PAYMENT_REQUIRED = 402;
100    /** {@code 403 Forbidden} (HTTP/1.0 - RFC 1945) */
101    public static final int SC_FORBIDDEN = 403;
102    /** {@code 404 Not Found} (HTTP/1.0 - RFC 1945) */
103    public static final int SC_NOT_FOUND = 404;
104    /** {@code 405 Method Not Allowed} (HTTP/1.1 - RFC 2616) */
105    public static final int SC_METHOD_NOT_ALLOWED = 405;
106    /** {@code 406 Not Acceptable} (HTTP/1.1 - RFC 2616) */
107    public static final int SC_NOT_ACCEPTABLE = 406;
108    /** {@code 407 Proxy Authentication Required} (HTTP/1.1 - RFC 2616)*/
109    public static final int SC_PROXY_AUTHENTICATION_REQUIRED = 407;
110    /** {@code 408 Request Timeout} (HTTP/1.1 - RFC 2616) */
111    public static final int SC_REQUEST_TIMEOUT = 408;
112    /** {@code 409 Conflict} (HTTP/1.1 - RFC 2616) */
113    public static final int SC_CONFLICT = 409;
114    /** {@code 410 Gone} (HTTP/1.1 - RFC 2616) */
115    public static final int SC_GONE = 410;
116    /** {@code 411 Length Required} (HTTP/1.1 - RFC 2616) */
117    public static final int SC_LENGTH_REQUIRED = 411;
118    /** {@code 412 Precondition Failed} (HTTP/1.1 - RFC 2616) */
119    public static final int SC_PRECONDITION_FAILED = 412;
120    /** {@code 413 Request Entity Too Large} (HTTP/1.1 - RFC 2616) */
121    public static final int SC_REQUEST_TOO_LONG = 413;
122    /** {@code 414 Request-URI Too Long} (HTTP/1.1 - RFC 2616) */
123    public static final int SC_REQUEST_URI_TOO_LONG = 414;
124    /** {@code 415 Unsupported Media Type} (HTTP/1.1 - RFC 2616) */
125    public static final int SC_UNSUPPORTED_MEDIA_TYPE = 415;
126    /** {@code 416 Requested Range Not Satisfiable} (HTTP/1.1 - RFC 2616) */
127    public static final int SC_REQUESTED_RANGE_NOT_SATISFIABLE = 416;
128    /** {@code 417 Expectation Failed} (HTTP/1.1 - RFC 2616) */
129    public static final int SC_EXPECTATION_FAILED = 417;
130
131    /**
132     * Static constant for a 418 error.
133     * {@code 418 Unprocessable Entity} (WebDAV drafts?)
134     * or {@code 418 Reauthentication Required} (HTTP/1.1 drafts?)
135     */
136    // not used
137    // public static final int SC_UNPROCESSABLE_ENTITY = 418;
138
139    /**
140     * Static constant for a 419 error.
141     * {@code 419 Insufficient Space on Resource}
142     * (WebDAV - draft-ietf-webdav-protocol-05?)
143     * or {@code 419 Proxy Reauthentication Required}
144     * (HTTP/1.1 drafts?)
145     */
146    public static final int SC_INSUFFICIENT_SPACE_ON_RESOURCE = 419;
147    /**
148     * Static constant for a 420 error.
149     * {@code 420 Method Failure}
150     * (WebDAV - draft-ietf-webdav-protocol-05?)
151     */
152    public static final int SC_METHOD_FAILURE = 420;
153    /** {@code 422 Unprocessable Entity} (WebDAV - RFC 2518) */
154    public static final int SC_UNPROCESSABLE_ENTITY = 422;
155    /** {@code 423 Locked} (WebDAV - RFC 2518) */
156    public static final int SC_LOCKED = 423;
157    /** {@code 424 Failed Dependency} (WebDAV - RFC 2518) */
158    public static final int SC_FAILED_DEPENDENCY = 424;
159
160    // --- 5xx Server Error ---
161
162    /** {@code 500 Server Error} (HTTP/1.0 - RFC 1945) */
163    public static final int SC_INTERNAL_SERVER_ERROR = 500;
164    /** {@code 501 Not Implemented} (HTTP/1.0 - RFC 1945) */
165    public static final int SC_NOT_IMPLEMENTED = 501;
166    /** {@code 502 Bad Gateway} (HTTP/1.0 - RFC 1945) */
167    public static final int SC_BAD_GATEWAY = 502;
168    /** {@code 503 Service Unavailable} (HTTP/1.0 - RFC 1945) */
169    public static final int SC_SERVICE_UNAVAILABLE = 503;
170    /** {@code 504 Gateway Timeout} (HTTP/1.1 - RFC 2616) */
171    public static final int SC_GATEWAY_TIMEOUT = 504;
172    /** {@code 505 HTTP Version Not Supported} (HTTP/1.1 - RFC 2616) */
173    public static final int SC_HTTP_VERSION_NOT_SUPPORTED = 505;
174
175    /** {@code 507 Insufficient Storage} (WebDAV - RFC 2518) */
176    public static final int SC_INSUFFICIENT_STORAGE = 507;
177
178}