When we encode a query not a url. we should use encodeURIComponent not encodeURI.
Because query value will contain = as character, it should be encode to %3D, but encodeURI will think it is Reserved Characters for url, actually query value is URI's component.
|
encode(typeof input === "string" ? input : JSON.stringify(input)) |