对于 POST
方法且 header['content-type']
为 application/json
的数据
在这种情况下,数据会进行序列化
要求后端用@RequestBody来标识请求参数
// 用户注册/登录
uni.request({
url: common.serverUrl + '/user/weChat/login',
method: "POST",
data: {
userName: userName,
password: password
},
header: {
// 对于 POST 方法且 header['content-type'] 为 application/json 的数据,会进行 JSON 序列化
// 要求后端用@RequestBody来标识请求参数
'content-type'