Content-type的几种常见类型

1、form表单类型 ,浏览器的原生form表单

application/x-www-form-urlencoded

 

2、我们使用表单上传文件时,必须让 form 的 enctype 等于这个值

multipart/form-data

<form action="/" method="post" enctype="multipart/form-data">
  <input type="text" name="description">
  <input type="file" name="myFile">
  <button type="submit">Submit</button>
</form>

 3、序列化后的 JSON 字符串,最常用,特别适合 RESTful 的接口

application/json

4、是一种使用 HTTP 作为传输协议,XML 作为编码方式的远程调用规范

text/xml

原文地址:https://www.cnblogs.com/mafy/p/11993336.html