const urlEncode = (obj) => { let params = Object.keys(obj).map(key => { return encodeURIComponent(key) + '=' + encodeURIComponent(obj[key]) }).join('&') return params }