I got a JavaScript object which I would like to get x-www-form-urlencoded.
x-www-form-urlencoded
Something like $(\'#myform\').serialize() but for objects.
$(\'#myform\').serialize()
I'm surprised that no one has mentioned URLSearchParams
URLSearchParams
var prms = new URLSearchParams({ firstName: "Jonas", lastName: "Gauffin" }); console.log(prms.toString()); // firstName=Jonas&lastName=Gauffin