My Java Blog Park

          http學(xué)習(xí)筆記

          一.HTTP請求:
          HTTP請求分為:
          ? 1).請求行
          ? 2).消息頭
          ? 3).空行
          ? 4).正文

          1.請求行
          ? [方法 URI HTTP版本信息]
          ? 如: GET /index.htm HTTP/1.0

          2.方法(全部大寫):
          ? GET????? 請求URI標(biāo)識的資源
          ? HEAD???? 請求獲取響應(yīng)消息頭
          ? PUT????? 請求存儲資源,并用URI作為其標(biāo)識
          ? POST???? 請求服務(wù)器接收信息
          ? CONNECT? ?
          ? TRACE???
          ? DELETE
          ? OPTIONS


          二.HTTP響應(yīng):
          ? 1).狀態(tài)行
          ? 2).消息頭
          ? 3).空行
          ? 4).正文(資源的內(nèi)容,比如index.htm文件的文本內(nèi)容)


          1.狀態(tài)行
          ? HTTP版本信息 狀態(tài)碼 響應(yīng)碼描述
          ? 例: HTTP/1.1 200 OK

          2.狀態(tài)碼(第一位表示響應(yīng)的類別)
          ? 1xx:
          ? 2xx:
          ? 3xx:
          ? 4xx:
          ? 5xx:
          HTTP協(xié)議狀態(tài)碼具體意義
          ?? 100? :? Continue
          ?? 101? :? witchingProtocols
          ?? 200? :? OK
          ?? 201? :? Created
          ?? 202? :? Accepted
          ?? 203? :? Non-AuthoritativeInformation
          ?? 204? :? NoContent
          ?? 205? :? ResetContent
          ?? 206? :? PartialContent
          ?? 300? :? MultipleChoices
          ?? 301? :? MovedPermanently
          ?? 302? :? Found
          ?? 303? :? SeeOther
          ?? 304? :? NotModified
          ?? 305? :? UseProxy
          ?? 307? :? TemporaryRedirect
          ?? 400? :? BadRequest
          ?? 401? :? Unauthorized
          ?? 402? :? PaymentRequired
          ?? 403? :? Forbidden
          ?? 404? :? NotFound
          ?? 405? :? MethodNotAllowed
          ?? 406? :? NotAcceptable
          ?? 407? :? ProxyAuthenticationRequired
          ?? 408? :? RequestTime-out
          ?? 409? :? Conflict
          ?? 410? :? Gone
          ?? 411? :? LengthRequired
          ?? 412? :? PreconditionFailed
          ?? 413? :? RequestEntityTooLarge
          ?? 414? :? Request-URITooLarge
          ?? 415? :? UnsupportedMediaType
          ?? 416? :? Requestedrangenotsatisfiable
          ?? 417? :? ExpectationFailed
          ?? 500? :? InternalServerError
          ?? 501? :? NotImplemented
          ?? 502? :? BadGateway
          ?? 503? :? ServiceUnavailable
          ?? 504? :? GatewayTime-out
          ?? 505? :? HTTPVersionnotsupported

          三.HTTP消息頭:
          1. 普通
          2. 請求頭
          3. 響應(yīng)頭
          4. 實(shí)體頭

          格式:(名字大小寫無關(guān))
          <名字>:<空格><值>

          1.普通頭
          ? .Cache-Control? (HTTP1.1,? HTTP1.0:Pragma)
          ????? 緩存指令:
          ????? 請求時: no-cache,no-store,max-age,max-stale,min-fresh,only-if-cached
          ????? 響應(yīng)時: public,private,no-cache,no-store,no-transform,must-revalidate,proxy-revalidate,max-age,s-maxage.
          ????? 例: Cache-Control: no-cache
          ? .Date
          ????? 客戶端:在發(fā)送正文時要包含Date,
          ????? 服務(wù)器:在響應(yīng)時包含Date.
          ? .Connection
          ? .Pragma(1.0用)

          2. 請求頭
          ? .Accept
          ? .Accept-Charset
          ? .Accept-Encoding
          ? .Accept-Language
          ? .Authorization
          ? .Host(必須的)
          ? .User-agent

          3.響應(yīng)頭
          ? .Location
          ? .Server
          ? .WWW-Authenticate,要包含在401中.

          4.實(shí)體頭
          ? .Content-Encoding
          ? .Content-Language
          ? .Content-Length
          ? .Content-Type
          ? .Last-Modified
          ? .Expires

          ?

          posted on 2006-09-28 15:53 2195113 閱讀(245) 評論(0)  編輯  收藏 所屬分類: Base Knowledge


          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 泗洪县| 禄丰县| 济南市| 册亨县| 新河县| 桃江县| 长治市| 克山县| 义马市| 卓资县| 郴州市| 桃江县| 新泰市| 乡城县| 河池市| 宁远县| 兴业县| 天等县| 新泰市| 常山县| 孟连| 科尔| 镇巴县| 高州市| 盐城市| 华池县| 临湘市| 沿河| 陆河县| 历史| 南岸区| 虎林市| 始兴县| 阿拉善左旗| 大洼县| 萍乡市| 天全县| 长顺县| 天峻县| 策勒县| 左贡县|