首页 > 技术文章 > uni-app网络请求

edward-life 2019-07-19 19:55 原文

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

 

推荐阅读