表单和json

表单和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}

你可能感兴趣的:(表单和json)