I want to send http request using node.js. I do:
http = require(\'http\'); var options = { host: \'www.mainsms.ru\', path: \'/api/mainsms/message/se
The best way is to use the native module QueryString :
var qs = require('querystring'); console.log(qs.escape('Hello $ é " \' & =')); // 'Hello%20%24%20%C3%A9%20%22%20\'%20%26%20%3D'
This is a native module, so you don't have to npm install anything.
npm install