1. 程式人生 > >http響應狀態碼

http響應狀態碼

accepted html 數據 fin 能夠 err 新的 指示 found

文章摘自: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;

http響應狀態碼