I've got a JSON object that looks something like
{
"version" : "22",
"who: : "234234234234"
}
And I need it in a string ready to be sent as a raw http body request.
So i need it to look like
version=22&who=234324324324
But It needs to work, for an infinite number of paramaters, at the moment I've got
app.jsonToRaw = function(object) {
var str = "";
for (var index in object) str = str + index + "=" + object[index] + "&";
return str.substring(0, str.length - 1);
};
However there must be a better way of doing this in native js?
Thanks