那天在帮同学调代码的时候发现自己对于HTTP Request的细节很模糊,对于各种形式的数据是如何被处理封装成HTTP报文的、在报文中的哪个位置,并不是非常的清楚,因此,查了查资料后写了这篇东西。
HTTP请求格式¶
先看看HTTP请求消息的格式 1:
- A Request Line
- Zero or more header (General|Request|Entity) fields followed by CRLF
- An empty line (i.e., a line with nothing preceding the CRLF) indicating the end of the header fields
- Optionally a message-body
从格式上来看,除了第三部分,都能够附带用户数据,但一般来说 ...