[关闭]
@JunQiu 2018-09-25T01:57:10.000000Z 字数 1505 阅读 281919

HTTP POST body常见的四种数据格式

http


1、HTTP POST body常见的四种数据格式

1.1、概述

  1. <method> <request-URL> <version>
  2. <headers>
  3. <entity-body>

1.2、body常见的四种数据格式

  1. POST http://www.example.com HTTP/1.1
  2. Content-Type: application/x-www-form-urlencoded;charset=utf-8
  3. title=test&sub%5B%5D=1&sub%5B%5D=2&sub%5B%5D=3url编码)
  1. POST http://www.example.com HTTP/1.1
  2. Content-Type:multipart/form-data; boundary=----WebKitFormBoundaryrGKCBY7qhFd3TrwA
  3. ------WebKitFormBoundaryrGKCBY7qhFd3TrwA
  4. Content-Disposition: form-data; name="text"
  5. title
  6. ------WebKitFormBoundaryrGKCBY7qhFd3TrwA
  7. Content-Disposition: form-data; name="file"; filename="chrome.png"
  8. Content-Type: image/png
  9. ... content of chrome.png(省略) ...
  10. ------WebKitFormBoundaryrGKCBY7qhFd3TrwA--
  1. POST http://www.example.com HTTP/1.1
  2. Content-Type: application/json;charset=utf-8
  3. {"title":"test","sub":[1,2,3]}
  1. POST http://www.example.com HTTP/1.1
  2. Content-Type: text/xml
  3. <?xml version="1.0"?>
  4. <methodCall>
  5. <methodName>examples.getStateName</methodName>
  6. <params>
  7. <param>
  8. <value><i4>41</i4></value>
  9. </param>
  10. </params>
  11. </methodCall>

1.3、参考文档

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注