訊息體

某些 HTTP 請求可能包含訊息正文。這是伺服器用於處理請求的其他資料。訊息體最常用於 POST 或 PATCH 和 PUT 請求,以提供伺服器應應用於資源的新資料。

包含訊息體的請求應始終包含其長度(以位元組為單位)和 Content-Length 標頭。

所有標頭和雙 CRLF 後面都包含一個訊息體。帶有正文的示例 PUT 請求可能如下所示:

PUT /files/129742 HTTP/1.1\r\n
Host: example.com\r\n
User-Agent: Chrome/54.0.2803.1\r\n
Content-Length: 202\r\n
\r\n
This is a message body. All content in this message body should be stored under the 
/files/129742 path, as specified by the PUT specification. The message body does
not have to be terminated with CRLF.

HEADTRACE 請求不得包含訊息正文。