Hidden features of HTTP

前端 未结 13 1081
醉话见心
醉话见心 2021-01-29 17:38

What hidden features of HTTP do you think are worth mentioning?

By hidden features I mean features that already are part of the standard but widely rath

相关标签:
13条回答
  • 2021-01-29 18:00

    Status codes :

    • When URI http://www.domain.invalid/index.php?id=44 is called, if the query (id=44) couldn't return ressource, why not return a status code 404?
    • When URI http://www.domain.invalid/index.php?id=foo is called whereas id only accepts integers, why not return a status code 400?
    • Why, when you enter the wrong login/password, almost all web application return a message like "Authentication failed" with status code 200 (ok, no problem, you do it well) instade of 401?

    Yes, status codes seems to be a kind of secret functionality of HTTP to some web developers... But I wonder if the most occult of all the "features" of this protocol isn't its RFC!

    0 讨论(0)
  • 2021-01-29 18:01

    Trailer (in contrast to Header)

    0 讨论(0)
  • 2021-01-29 18:03

    Obvious answer: PUT, DELETE, TRACE, OPTIONS, CONNECT methods

    Most people know about the GET and POST methods because that's what they use when building forms. Browsers also use HEAD a lot. The other methods are much less well-known; they are mostly used by more specific applications.

    0 讨论(0)
  • 2021-01-29 18:03

    ReST tries to push HTTP to its limits as an interface protocol.

    It's not a hidden feature, but from looking at well-defined ReST APIs one can get quite a nice grip on how HTTP is meant to work and find wonderful examples of what can be achieved with simple combination of HTTP methods, status codes and headers to and fro.

    0 讨论(0)
  • 2021-01-29 18:05

    The fact that referrer was misspelled and it was decided that the misspelling should be kept.

    0 讨论(0)
  • 2021-01-29 18:05

    The protocol allows you to define your own custom-fields. These can be used to carry other information if you don't want to use cookies for it.

    0 讨论(0)
提交回复
热议问题