常见的post请求提交的数据类型有四种:
1.第一种:application/json:这是最常见的json格式,如下
{"input1":"XXX","input2":"ooo","remember":false}
2.第二种:application/x-www-form-urlencoded:浏览器的原生form表单,如果不设置enctype属性,最终会以application/x-www-form-urlencoded方式提交数据
input1=xxx&input2=ooo&remember=false
3.第三种:multipart/form-data:这是一种表单格式的,数据类型如下
------WebKitFormBoundaryrGKCBY7qhFd3TrwA
Content-Disposition: form-data; name="text"title------WebKitFormBoundaryrGKCBY7qhFd3TrwAContent-Disposition: form-data; name="file"; filename="chrome.png"Content-Type: image/pngPNG ... content of chrome.png ...------WebKitFormBoundaryrGKCBY7qhFd3TrwA--
4.第四种:text/xml:直接传xml格式
<!--?xml version="1.0"?-->
<methodcall><methodname>examples.getStateName</methodname><params><param><value><i4>41</i4></value></params></methodcall>