Skip to content

Instantly share code, notes, and snippets.

@haoch
Created January 2, 2014 06:50
Show Gist options
  • Save haoch/8215804 to your computer and use it in GitHub Desktop.
Save haoch/8215804 to your computer and use it in GitHub Desktop.
NodeJS common functions
var encodeURIParameter= function(obj) {
var str = [];
for(var p in obj){
if (obj.hasOwnProperty(p)) {
str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
}
}
return str.join("&");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment