HTTP協議常見的響應

來源:互聯網
上載者:User

理論基礎:

HTTP 協議是超文字傳輸通訊協定 (HTTP)的簡稱,主要內容定義在RFC2616。

HTTP協議由來自用戶端(瀏覽器)的請求和來自服務端(web伺服器)的回應群組成。

HTTP請求的方法有:

Method         = "OPTIONS"                ; Section 9.2                      | "GET"                    ; Section 9.3                      | "HEAD"                   ; Section 9.4                      | "POST"                   ; Section 9.5                      | "PUT"                    ; Section 9.6                      | "DELETE"                 ; Section 9.7                      | "TRACE"                  ; Section 9.8                      | "CONNECT"                ; Section 9.9                      | extension-method       extension-method = token

其中GET POST HEAD是最常用的,其他的不經常用。

HTTP協議常見的響應:

Status-Code    =            "100"  ; Section 10.1.1: Continue          | "101"  ; Section 10.1.2: Switching Protocols          | "200"  ; Section 10.2.1: OK          | "201"  ; Section 10.2.2: Created          | "202"  ; Section 10.2.3: Accepted          | "203"  ; Section 10.2.4: Non-Authoritative Information          | "204"  ; Section 10.2.5: No Content          | "205"  ; Section 10.2.6: Reset Content          | "206"  ; Section 10.2.7: Partial Content          | "300"  ; Section 10.3.1: Multiple Choices          | "301"  ; Section 10.3.2: Moved Permanently          | "302"  ; Section 10.3.3: Found          | "303"  ; Section 10.3.4: See Other          | "304"  ; Section 10.3.5: Not Modified          | "305"  ; Section 10.3.6: Use Proxy          | "307"  ; Section 10.3.8: Temporary Redirect          | "400"  ; Section 10.4.1: Bad Request          | "401"  ; Section 10.4.2: Unauthorized          | "402"  ; Section 10.4.3: Payment Required          | "403"  ; Section 10.4.4: Forbidden          | "404"  ; Section 10.4.5: Not Found          | "405"  ; Section 10.4.6: Method Not Allowed          | "406"  ; Section 10.4.7: Not Acceptable          | "407"  ; Section 10.4.8: Proxy Authentication Required                    | "408"  ; Section 10.4.9: Request Time-out                    | "409"  ; Section 10.4.10: Conflict                    | "410"  ; Section 10.4.11: Gone                    | "411"  ; Section 10.4.12: Length Required                    | "412"  ; Section 10.4.13: Precondition Failed                    | "413"  ; Section 10.4.14: Request Entity Too Large                    | "414"  ; Section 10.4.15: Request-URI Too Large                    | "415"  ; Section 10.4.16: Unsupported Media Type                    | "416"  ; Section 10.4.17: Requested range not satisfiable                    | "417"  ; Section 10.4.18: Expectation Failed                    | "500"  ; Section 10.5.1: Internal Server Error                    | "501"  ; Section 10.5.2: Not Implemented                    | "502"  ; Section 10.5.3: Bad Gateway                    | "503"  ; Section 10.5.4: Service Unavailable                    | "504"  ; Section 10.5.5: Gateway Time-out                    | "505"  ; Section 10.5.6: HTTP Version not supported                    | extension-code

實驗部分:

使用telnet做HTTP協議互動示範.

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.