uni-app网络请求

对于 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 类型,需要自定义头文件。

原文地址:https://www.cnblogs.com/edward-life/p/11215448.html