Node.js examples for Network:URL
Convert String to URL params string
String.prototype.escape = function( find ) { return this.replace( new RegExp( find, 'g' ), '\\' + find ); }; String.prototype.appendParams = function( params ) { var updatedString = this; for ( var key in params ) { if ( updatedString.indexOf( key + '=' ) > -1 ) continue;// w w w . j a va 2 s . c om if ( updatedString.indexOf( '?' ) > -1 ) updatedString += '&' + key + '=' + params[key]; else updatedString += '?' + key + '=' + params[key]; } return updatedString; };