js对象格式化为表单数据

只适用于 简单的数据转换

function (data) {
              // Do whatever you want to transform the data
              let ret = ‘‘
              for (let it in data) {
                ret += encodeURIComponent(it) + ‘=‘ + encodeURIComponent(data[it]) + ‘&‘
              }
              return ret
 }

相关推荐