原創(chuàng)聲明:本文為作者原創(chuàng),未經(jīng)允許不得轉(zhuǎn)載,經(jīng)授權(quán)轉(zhuǎn)載需注明作者和出處
個(gè)人在使用社區(qū)API put數(shù)據(jù)的時(shí)候發(fā)現(xiàn)返回102:參數(shù)錯(cuò)誤 提示,代碼如下:
wx.request({
url: 'https://api.wxappclub.com/put',
data: {
appkey: appKey,
type: 'bookLibrary',
key: "test",
value: {emono:"FE716",age:"18"}
},
header: {
'content-type': 'application/json'
},
success: function (res) {
console.log(res);
}
});
然后參考了toBeMN的帖子,修改代碼如下:
http://m.guanlustone.com/topic/116
wx.request({
url: 'https://api.wxappclub.com/put',
data: {
appkey: appKey,
type: 'bookLibrary',
key: "test",
value: {emono:"FE716",age:"18"}
},
method: 'POST',
header: {
'content-type': 'application/x-www-form-urlencoded'
},
success: function (res) {
console.log(res);
}
});
數(shù)據(jù)是可以存進(jìn)去,但是value顯示的是[object Object],請(qǐng)問(wèn)大家是怎么把一個(gè)復(fù)雜結(jié)構(gòu)的json存到value內(nèi)的呢?