Hidden features of HTTP

2019-03-07 09:18发布

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 rather unknown or unused.

Just one feature per answer please.

标签: http
13条回答
Evening l夕情丶
2楼-- · 2019-03-07 09:40

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.

查看更多
我欲成王,谁敢阻挡
3楼-- · 2019-03-07 09:44

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

查看更多
Juvenile、少年°
4楼-- · 2019-03-07 09:46

204 No Content

I thought 204 was just if you have no content to display, but the spec looks like there is additional behavior that the user agent "not change its document view."

According to HOWTO: Configure Apache to Return a HTTP 204 (No Content) for AJAX

FWIW, Google actually does something similar. Each time a user clicks on a link in their search results, Google pings itself to record the click; the response code from the ping is an HTTP 204.

Also, 204 No Content proposes this is a good technique for "web bugs" or "beacons" if you want to save on every last byte of network traffic you can.

查看更多
爷、活的狠高调
5楼-- · 2019-03-07 09:47

Have anyone ever seen 402 Payment Required?

查看更多
迷人小祖宗
6楼-- · 2019-03-07 09:47

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!

查看更多
够拽才男人
7楼-- · 2019-03-07 09:50

Response Code 410 Gone:

(...) server owners desire that remote links to that resource be removed. (...)

Web spiders (most notably Google) will de-index (typically on next crawl) a page which starts returning 410.

查看更多
登录 后发表回答