form-data 方式请求:
请求报文:
POST /api/File/FileUpload?userId=test&Password=test&ID=542 HTTP/1.1
Host: 172.17.0.208:49842
Content-Length: 528
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
Cache-Control: no-cache
Origin: chrome-extension://fhbjgbiflinjbdggehcddcbncdddomop
Postman-Token: a39755f7-95a6-92d2-740b-90ec8ac13c44
Content-Type: multipart/form-data; boundary=----WebKitFormBoundary49yOf7hwb9ZSelpR //边界信息
Accept: */*
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7,de;q=0.6
------WebKitFormBoundary49yOf7hwb9ZSelpR
Content-Disposition: form-data; name="file1"; filename="test.txt"
Content-Type: text/plain
333333 //第一个文件内容 ,可以是二进制形式
------WebKitFormBoundary49yOf7hwb9ZSelpR
Content-Disposition: form-data; name="String1"
123 //第一个String 字符串内容
------WebKitFormBoundary49yOf7hwb9ZSelpR
Content-Disposition: form-data; name="file2"; filename="test.txt"
Content-Type: text/plain
333333 //第二个文件内容 ,可以是二进制形式
------WebKitFormBoundary49yOf7hwb9ZSelpR
Content-Disposition: form-data; name="String2"
234 //第二个String 字符串内容
------WebKitFormBoundary49yOf7hwb9ZSelpR-- //请求结束行标识
x-www-form-urlencoded 方式请求:
报文信息:
POST /api/File/FileUpload?userId=test&Password=test&ID=542 HTTP/1.1
Host: 172.17.0.208:49842
Content-Length: 25
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
Cache-Control: no-cache
Origin: chrome-extension://fhbjgbiflinjbdggehcddcbncdddomop
Postman-Token: 40ec2c16-75ff-7c5a-08c2-1fd3aa9dc83a
Content-Type: application/x-www-form-urlencoded
Accept: */*
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7,de;q=0.6
String1=1234&String2=1234
raw Json 形式上传:raw
形式上传请求报文都是只有一个 没有键值对
请求报文:
POST /api/File/FileUpload?userId=test&Password=test&ID=542 HTTP/1.1
Host: 172.17.0.208:49842
Content-Length: 20
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
Cache-Control: no-cache
Origin: chrome-extension://fhbjgbiflinjbdggehcddcbncdddomop
Postman-Token: e7f0892f-42ab-6f84-6898-bd6f255462b8
Content-Type: application/json
Accept: */*
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7,de;q=0.6
{name:'lisa',age:12}