Tornado Documentation
› http://www.v2ex.com/tornado/
Tornado on GitHub
› https://github.com/facebook/tornado/
Tornado Gists
› http://tornadogists.org/
zeyexe
V2EX  ›  Tornado

Tornado怎么实现head方法?

  •  
  •   zeyexe · Aug 5, 2013 · 5775 views
    This topic created in 4820 days ago, the information mentioned may be changed or developed.
    我想要的效果是head方法能正确显示get方法的Content-Length,而不是Content-Length为0。

    正确的实现方式是什么?
    3 replies  •  1970-01-01 08:00:00 +08:00
    yemoluo
        1
    yemoluo  
       Aug 6, 2013
    head 方法返回值是没有body的...
    yemoluo
        2
    yemoluo  
       Aug 6, 2013
    看 http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html 中的 head:

    The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response.
    zeyexe
        3
    zeyexe  
    OP
       Aug 6, 2013
    @GTim 其实我想要的head就是get去掉body的那些东西(headers),但是在tornado下面,除非把head方法用get的方法的方式实现一次,否则head返回的值和get返回的headers有差异。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2521 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 00:31 · PVG 08:31 · LAX 17:31 · JFK 20:31
    ♥ Do have faith in what you're doing.