貌似沒有現成的對象轉字符串的函數,遂本身寫一個 javascript
function obj2str(obj) { var obj_keys = Object.keys(obj); var obj_values = Object.values(obj); var str_arr = []; for(var i = 0; i < obj_keys.length; i++) { str_arr.push(obj_keys[i] + '=' + obj_values[i]); } return str_arr.join('&'); }