javascript http request encode query code example
Example 1: javascript object to params string
var queryString = Object.keys(params).map(key => key + '=' + params[key]).join('&');
Example 2: object to query string js
const obj = {foo: "hi there", bar: "100%" };
const params = new URLSearchParams(obj).toString();