uniapp使用uni.request发送formData格式请求
文章目录
只需要把headers的Content-Type设置成application/x-www-form-urlencoded即可发送formData格式请求
uni.request({
url: url, // 请求接口
data: data, // 发送参数
method: method || 'GET', // 参数类型
header: {
"Content-Type": "application/x-www-form-urlencoded"
}, // 请求头
dataType: 'json', // 返回数据格式
success(response) {
},
fail(error) {
},
complete(com) {
}
})

评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论