Http协议中的HeaderBody

Header的每行最后要加\r\n

HeaderBody之间要用\r\n隔开

Body后无需加\r\n

ACSII码中

'\n' 10 换行

'\r' 13 回车

也可以表示为'\x0a''\x0d'.(16进制)

示例:HTTP开始部分为header<html>部分为body

HTTP/1.1 200 OK\r\n

Content-Encoding: gzip\r\n

Content-Type: text/xml\r\n

Content-Length: 399\r\n

Connection: keep-alive\r\n

X-Varnish-Cache: HIT\r\n

X-Varnish-Cache-Hits: 1241\r\n

\r\n

<html.....</html>

原文:

http://hi.baidu.com/sinfiasong/item/38776830ed3034149cc65e3a

相关文章:

  • 2021-08-01
  • 2021-04-17
  • 2022-12-23
  • 2022-12-23
  • 2021-08-26
  • 2022-01-17
  • 2022-01-31
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-02
  • 2021-10-07
相关资源
相似解决方案