Jenney Zhao

导航

Expect: 100-continue

‍Expect:100-Continue

(转自http://hi.baidu.com/leo_han/item/9bdd1068bc6f7131ad3e8333

HTTP1.1(RFC2616)中的描述是:

The purpose of the 100 (Continue) status (see section 10.1.1) is to   allow a client that is sending a request message with a request body   to determine if the origin server is willing to accept the request   (based on the request headers) before the client sends the request   body. In some cases, it might either be inappropriate or highly   inefficient for the client to send the body if the server will reject   the message without looking at the body.

   Requirements for HTTP/1.1 clients:

      - If a client will wait for a 100 (Continue) response before
        sending the request body, it MUST send an Expect request-header
        field (section 14.20) with the "100-continue" expectation.
      - A client MUST NOT send an Expect request-header field (section
        14.20) with the "100-continue" expectation if it does not intend
        to send a request body.

就是说 ‍Expect:100-Continue的作用是,设定Client 和 Server在Post数据前需要进行 ‍“请求头域” 的数据匹配,相当于是握手。如果匹配则开始进行body 的内容,Post数据。否则,报错(417) Unkown

posted on 2013-03-07 16:28  Jenney Zhao  阅读(1050)  评论(0编辑  收藏  举报