HTTP请求 content-type

179 阅读1分钟

1、JSON类型

  • 值: application/json
  • 示例
    name: 'xxx',
    age: 'xxx'

2、url参数

  • 值: application/x-www-form-urlencoded
  • 示例
    ?name=xxx&age=xxx

3、formData

  • 值: formData
  • 示例
    let formData = new FormData()  
    formData.append('name', 'xxx')  
    formData.append('age', 'xxx')