表单和json
2018-11-10 本文已影响11人
ElonYanJ
表单和json都存到body中
body类型写在请求头中 content-type
Media Type/Content Type/MIME Type 这三者都是指同一个东西,即互联网媒体类型
HTTP POST
header:
Content-Type: "application/json"
body:
{
"key1": value1,
"key2": value2
}
HTTP POST
header:
Content-Type: "x-www-form-urlencoded"
body:
key1=value1&key2=value2
HTTP POST
header:
Content-Type: "x-www-form-urlencoded"
body:
key1=value1
key2={"key3":value3, "key4": value4}