我的帖子数据有问题,
let bodydata = JSON.stringify({
fonk: 'usrlogin',
login_userid: '111111',
passsha:'d4c59285sds62233bc232e0f205esd8b7e'
});
let bodydata1 = "fonk=usrlogin&login_userid=111111&passsha=d4c59285sds62233bc232e0f205esd8b7e"
const data = yield call(request, 'http://11.11.11.11/JSONRESTfulServices-1/rest/products/solrpost', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
body: bodydata1
});
yield put(dropExternal(data))
我可以用'bodydata1'获取数据,但我想采取'bodydata'这样,成为常规和可读的代码,如何
答案 0 :(得分:0)
我找到了,
let bodydata = jQuery.param({
fonk: 'usrlogin',
login_userid: '111111',
passsha:'d4c59285sds62233bc232e0f205esd8b7e'
});
Jquery.param