对于 GET 方法,会将数据转换为 query string。例如 { name: 'name', age: 18 } 转换后的结果是 name=name&age=18

对于 POST 方法且 header['content-type'] 为 application/json 的数据,会进行 JSON 序列化。

对于 POST 方法且 header['content-type'] 为 application/x-www-form-urlencoded 的数据,会将数据转换为 query string。

当传输的数据为多个字符串时需要将对象类型转化为 query string 类型,需要自定义头文件。

 

相关文章:

  • 2021-05-17
  • 2022-12-23
  • 2022-02-14
  • 2022-12-23
  • 2021-12-22
  • 2021-07-12
  • 2021-09-27
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2019-12-09
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案