What is the smallest possible http and https data request

前端 未结 3 1407
伪装坚强ぢ
伪装坚强ぢ 2021-02-19 19:05

Lets say I want to GET one byte from a server using the http protocol and I want to minimize everything, no headers just http://myserver.com/b where b is a text file with one ch

3条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-19 19:30

    What exactly are you trying to achieve, is this a sort of keep alive?

    You could do a "GET /", which implies HTTP/1.0 being used, but that locks you out of stuff like virtual hosting etc. You can map "/" to a cgi-script, it doesn't need to be a real file, depending on what you're trying to achieve. You can configure Apache to only return the minimum set of headers, which would basically be "Content-Type: text/plain" (or another, shorter mime type, possibly custom mimetype e.g. "Content-Type: a/b") and "Content-Length: 0", thus not returning a response body at all.

提交回复
热议问题