In Node.js (using Express.js), when I call http.request like such:
var options = {
host: '127.0.0.1',
port: 80,
path: '/',
query: {name: "John Doe", age: 50} // <---- problem here
};
http.request(options, function(response) { ... });
all is well, except the query part of options is ignored. Documentation says the query string must be constructed manually, and passed inside path: something like path: '/?name=John%20Doe&age=50'.
What is the best way to achieve that? query is a simple hash of string->{string, number}.