码迷,mamicode.com
首页 > 移动开发 > 详细

uni-app网络请求

时间:2019-07-19 21:12:33      阅读:142      评论:0      收藏:0      [点我收藏+]

标签:网络   字符串   encode   传输   对象类型   序列化   type   cat   序列   

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

uni-app网络请求

标签:网络   字符串   encode   传输   对象类型   序列化   type   cat   序列   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!