Page 87 - HTTP权威指南
P. 87

៓બഗॽຕ਍֭෇
                                                      Ԓ࿔ํ༹ڦዷ༹ዐ




                            ൩൱Ԓ࿔
                            POST /inventory-check.cgi HTTP/1.1
                            Host: www.joes-hardware.com
                            Content-type: text/plain
                            Content-length: 18
                            item=bandsaw 2647


                                      ၚᆌԒ࿔                                          YES!
                     ਜ਼ࢽ܋                                        www.joes-hardware.com
                                      HTTP/1.1 200 OK
                                      Content-type: text/plain
                                      Context-length: 37
                                                                 “item= bandsaw 2647”
                                      The bandsaw model 2647 is in stock!

                                                                           CGIײႾ
                                                                                  ੰ٪ॠֱ

                                                                            ੰ٪
                                                                            ൣڇ

                 图 3-10 POST 示例

                         请求报文
                                                      TRACE /product-list.txt HTTP/1.1
                          TRACE /product-list.txt HTTP/1.1  Host: www.joes-hardware.com
                          Accept: *                   Accept: *
                          Host: www.joes-hardware.com  Via: 1.1 proxy3.company.com




                   客户端                            代理                    www.joes-hardware.com
                                                      响应报文
                          HTTP/1.1 200 OK              HTTP/1.1 200 OK
                          Content-type: text/plain     Content-type: text/plain
                          Content-length: 96           Content-length: 96
                          Via: 1.1 proxy3.company.com
                                                       TRACE /product-list.txt HTTP/1.1
                          TRACE /product-list.txt HTTP/1.1  Host: www.joes-hardware.com
                          Host: www.joes-hardware.com  Accept: *
                          Accept: *                    Via: 1.1 proxy3.company.com
                          Via: 1.1 proxy3.company.com
                           通过对实体部分检查,客户端可以看出这条请求被升级成了协议版本1.1。
                           升级的同时还添加了几个额外的请求首部。

                 图 3-11 TRACE 示例

                                                                             HTTP报文   |   59
   82   83   84   85   86   87   88   89   90   91   92