var param = {
"regionCodes": "110000,120000,13000",
"purchaseGroups": "A01,A02",
"feedBackType": "0",
"isReplied": "0",
"bTime": "20170301",
"eTime": "20170431",
"page": 0,
"size": 20
}
It turns out that the post method can pass parameters directly. Now we use the get method first, so we need to splice the parameters after the url.
Similar form:
/ask?regionCodes=110000,120000,13000&purchaseGroups=A01,A02&feedBackType='0'
...
Write a function but it cannot meet the requirements (cannot handle commas)
function changeParam(param){
return JSON.stringify(param).replace(/:/g,'=').replace(/,/g,'&').replace(/{/g,'?').replace(/}/g,'').replace(/"/g,'');
}
求一个函数完美转换的函数