请求由三部分组成
可以用 telnet 程序测试
GET /test2?name=%E5%BC%A0&age=20 HTTP/1.1
Host: localhost

POST /test2 HTTP/1.1
Host: localhost
Content-Type: application/x-www-form-urlencoded
Content-Length: 21
name=%E5%BC%A0&age=18
application/x-www-form-urlencoed 格式细节:
POST /test3 HTTP/1.1
Host: localhost
Content-Type: application/json
Content-Length: 25
{"name":"zhang","age":18}
使用的是utf-8编码,汉字占3个字节,注意Content-Length
json 对象格式
{"属性名":属性值}
其中属性值可以是
json 数组格式
[元素1, 元素2, ...]
POST /test2 HTTP/1.1
Host: localhost
Content-Type: multipart/form-data; boundary=123
Content-Length: 125
--123
Content-Disposition: form-data; name="name"
lisi
--123
Content-Disposition: form-data; name="age"
30
--123--
multipart/form-data; boundary=123
--分隔符--分隔符--
客户端发送
服务端接收