Http Status Code/http响应状态码

文章摘自:http://hi.baidu.com/starsecond/blog/item/de75458a3cb1b51ac9fc7a6a.html

============================================================================

100 Continue
指示客户端应该继续请求。回送用于通知客户端此次请求已经收到,并且没有被服务器拒绝。
客户端应该继续发送剩下的请求数据或者请求已经完成,或者忽略回送数据。服务器必须发送
最后的回送在请求之后。
101 Switching Protocols
服务器依照客服端请求,通过Upgrade头信息,改变当前连接的应用协议。服务器将根据Upgrade头立刻改变协议
在101回送以空行结束的时候。
Successful
=================================
200 OK
指示客服端的请求已经成功收到,解析,接受。
201 Created
请求已经完成并一个新的返回资源被创建。被创建的资源可能是一个URI资源,通常URI资源在Location头指定。回送应该包含一个实体数据
并且包含资源特性以及location通过用户或者用户代理来选择合适的方法。实体数据格式通过煤体类型来指定即content-type头。最开始服务器
必须创建指定的资源在返回201状态码之前。如果行为没有被立刻执行,服务器应该返回202。
202 Accepted
请求已经被接受用来处理。但是处理并没有完成。请求可能或者根本没有遵照执行,因为处理实际执行过程中可能被拒绝。
203 Non-Authoritative Information
204 No Content
服务器已经接受请求并且没必要返回实体数据,可能需要返回更新信息。回送可能包含新的或更新信息由entity-headers呈现。
205 Reset Content
服务器已经接受请求并且用户代理应该重新设置文档视图。
206 Partial Content
服务器已经接受请求GET请求资源的部分。请求必须包含一个Range头信息以指示获取范围可能必须包含If-Range头信息以成立请求条件。
Redirection
==================================
300 Multiple Choices
请求资源符合任何一个呈现方式。
301 Moved Permanently
请求的资源已经被赋予一个新的URI。
302 Found
通过不同的URI请求资源的临时文件。
303 See Other
304 Not Modified
如果客服端已经完成一个有条件的请求并且请求是允许的,但是这个文档并没有改变,服务器应该返回304状态码。304
状态码一定不能包含信息主体,从而通常通过一个头字段后的第一个空行结束。
305 Use Proxy
请求的资源必须通过代理(由Location字段指定)来访问。Location资源给出了代理的URI。
306 Unused
307 Temporary Redirect
Client Error
=====================
400 Bad Request
因为错误的语法导致服务器无法理解请求信息。
401 Unauthorized
如果请求需要用户验证。回送应该包含一个WWW-Authenticate头字段用来指明请求资源的权限。
402 Payment Required
保留状态码
403 Forbidden
服务器接受请求,但是被拒绝处理。
404 Not Found
服务器已经找到任何匹配Request-URI的资源。
405 Menthod Not Allowed
Request-Line请求的方法不被允许通过指定的URI。
406 Not Acceptable
407 Proxy Authentication Required
408 Reqeust Timeout
客服端没有提交任何请求在服务器等待处理时间内。
409 Conflict
410 Gone
411 Length Required
服务器拒绝接受请求在没有定义Content-Length字段的情况下。
412 Precondition Failed
413 Request Entity Too Large
服务器拒绝处理请求因为请求数据超过服务器能够处理的范围。服务器可能关闭当前连接来阻止客服端继续请求。
414 Request-URI Too Long
服务器拒绝服务当前请求因为URI的长度超过了服务器的解析范围。
415 Unsupported Media Type
服务器拒绝服务当前请求因为请求数据格式并不被请求的资源支持。
416 Request Range Not Satisfialbe
417 Expectation Failed
Server Error
===================================
500 Internal Server Error
服务器遭遇异常阻止了当前请求的执行
501 Not Implemented
服务器没有相应的执行动作来完成当前请求。
502 Bad Gateway
503 Service Unavailable
因为临时文件超载导致服务器不能处理当前请求。
504 Gateway Timeout
505 Http Version Not Supported

-------------------------------------------------

http://status-code.com/

  • 100 Continue
  • 101 Switching Protocols
  • 102 Processing
  • 200 OK
  • 201 Created
  • 202 Accepted
  • 203 Non-Authoritative Information
  • 204 No Content
  • 205 Reset Content
  • 206 Partial Content
  • 207 Multi-Status
  • 226 IM Used
  • 300 Multiple Choices
  • 301 Moved Permanently
  • 302 Found
  • 303 See Other
  • 304 Not Modified
  • 305 Use Proxy
  • 306 (Unused)
  • 307 Temporary Redirect
  • 400 Bad Request
  • 401 Unauthorized
  • 402 Payment Required
  • 403 Forbidden
  • 404 Not Found
  • 405 Method Not Allowed
  • 406 Not Acceptable
  • 407 Proxy Authentication Required
  • 408 Request Timeout
  • 409 Conflict
  • 410 Gone
  • 411 Length Required
  • 412 Precondition Failed
  • 413 Request Entity Too Large
  • 414 Request-URI Too Long
  • 415 Unsupported Media Type
  • 416 Requested Range Not Satisfiable
  • 417 Expectation Failed
  • 418 I'm a teapot
  • 422 Unprocessable Entity
  • 423 Locked
  • 424 Failed Dependency
  • 425 (Unordered Collection)
  • 426 Upgrade Required
  • 500 Internal Server Error
  • 501 Not Implemented
  • 502 Bad Gateway
  • 503 Service Unavailable
  • 504 Gateway Timeout
  • 505 HTTP Version Not Supported
  • 506 Variant Also Negotiates
  • 507 Insufficient Storage
  • 510 Not Extended
  • java HttpURLConnection提供的响应值为

    /**
         * HTTP Status-Code 200: OK.
         */
        public static final int HTTP_OK = 200;

        /**
         * HTTP Status-Code 201: Created.
         */
        public static final int HTTP_CREATED = 201;

        /**
         * HTTP Status-Code 202: Accepted.
         */
        public static final int HTTP_ACCEPTED = 202;

        /**
         * HTTP Status-Code 203: Non-Authoritative Information.
         */   
        public static final int HTTP_NOT_AUTHORITATIVE = 203;

        /**
         * HTTP Status-Code 204: No Content.
         */
        public static final int HTTP_NO_CONTENT = 204;

        /**
         * HTTP Status-Code 205: Reset Content.
         */
        public static final int HTTP_RESET = 205;

        /**
         * HTTP Status-Code 206: Partial Content.
         */
        public static final int HTTP_PARTIAL = 206;

        /* 3XX: relocation/redirect */

        /**
         * HTTP Status-Code 300: Multiple Choices.
         */
        public static final int HTTP_MULT_CHOICE = 300;

        /**
         * HTTP Status-Code 301: Moved Permanently.
         */
        public static final int HTTP_MOVED_PERM = 301;

        /**
         * HTTP Status-Code 302: Temporary Redirect.
         */
        public static final int HTTP_MOVED_TEMP = 302;
        /**
         * HTTP Status-Code 303: See Other.
         */
        public static final int HTTP_SEE_OTHER = 303;

        /**
         * HTTP Status-Code 304: Not Modified.
         */
        public static final int HTTP_NOT_MODIFIED = 304;

        /**
         * HTTP Status-Code 305: Use Proxy.
         */
        public static final int HTTP_USE_PROXY = 305;

        /* 4XX: client error */

        /**
         * HTTP Status-Code 400: Bad Request.
         */
        public static final int HTTP_BAD_REQUEST = 400;

        /**
         * HTTP Status-Code 401: Unauthorized.
         */
        public static final int HTTP_UNAUTHORIZED = 401;

        /**
         * HTTP Status-Code 402: Payment Required.
         */
        public static final int HTTP_PAYMENT_REQUIRED = 402;

        /**
         * HTTP Status-Code 403: Forbidden.
         */
        public static final int HTTP_FORBIDDEN = 403;

        /**
         * HTTP Status-Code 404: Not Found.
         */
        public static final int HTTP_NOT_FOUND = 404;

        /**
         * HTTP Status-Code 405: Method Not Allowed.
         */
        public static final int HTTP_BAD_METHOD = 405;

        /**
         * HTTP Status-Code 406: Not Acceptable.
         */
        public static final int HTTP_NOT_ACCEPTABLE = 406;

        /**
         * HTTP Status-Code 407: Proxy Authentication Required.
         */
        public static final int HTTP_PROXY_AUTH = 407;

        /**
         * HTTP Status-Code 408: Request Time-Out.
         */
        public static final int HTTP_CLIENT_TIMEOUT = 408;

        /**
         * HTTP Status-Code 409: Conflict.
         */
        public static final int HTTP_CONFLICT = 409;

        /**
         * HTTP Status-Code 410: Gone.
         */
        public static final int HTTP_GONE = 410;

        /**
         * HTTP Status-Code 411: Length Required.
         */
        public static final int HTTP_LENGTH_REQUIRED = 411;

        /**
         * HTTP Status-Code 412: Precondition Failed.
         */
        public static final int HTTP_PRECON_FAILED = 412;

        /**
         * HTTP Status-Code 413: Request Entity Too Large.
         */
        public static final int HTTP_ENTITY_TOO_LARGE = 413;

        /**
         * HTTP Status-Code 414: Request-URI Too Large.
         */
        public static final int HTTP_REQ_TOO_LONG = 414;

        /**
         * HTTP Status-Code 415: Unsupported Media Type.
         */
        public static final int HTTP_UNSUPPORTED_TYPE = 415;
        /* 5XX: server error */

        /**
         * HTTP Status-Code 500: Internal Server Error.
         * @deprecated   it is misplaced and shouldn't have existed.
         */
        @Deprecated
        public static final int HTTP_SERVER_ERROR = 500;

        /**
         * HTTP Status-Code 500: Internal Server Error.
         */
        public static final int HTTP_INTERNAL_ERROR = 500;

        /**
         * HTTP Status-Code 501: Not Implemented.
         */
        public static final int HTTP_NOT_IMPLEMENTED = 501;

        /**
         * HTTP Status-Code 502: Bad Gateway.
         */
        public static final int HTTP_BAD_GATEWAY = 502;

        /**
         * HTTP Status-Code 503: Service Unavailable.
         */
        public static final int HTTP_UNAVAILABLE = 503;

        /**
         * HTTP Status-Code 504: Gateway Timeout.
         */
        public static final int HTTP_GATEWAY_TIMEOUT = 504;

        /**
         * HTTP Status-Code 505: HTTP Version Not Supported.
         */
        public static final int HTTP_VERSION = 505;

  • posted on 2011-04-06 17:07  elaborateday  阅读(2926)  评论(0编辑  收藏  举报