http中的head與body怎麼組成的
來源:魅力女性吧 1.57W
Http協議中的Header與Body
Header的每行最後要加rn
Header與Body之間要用rn隔開
Body後無需加rn
ACSII碼中
'n' 10 換行
'r' 13 回車
也可以表示爲'x0a'和'x0d'.(16進制)
示例:HTTP開始部分爲header,<html>部分爲body。
HTTP/1.1 200 OKrn
Content-Encoding: gziprn
Content-Type: text/xmlrn
Content-Length: 399rn
Connection: keep-alivern
X-Varnish-Cache: HITrn
X-Varnish-Cache-Hits: 1241rn
rn
<html.....</html>