In Node.js (using Express.js), when I call http.requestlike this:
var options = {
host: '127.0.0.1',
port: 80,
path: '/',
query: {name: "John Doe", age: 50}
};
http.request(options, function(response) { ... });
all is well, except that some of the parameters are queryignored. The documentation says that the query string should be built manually and passed inside path: something like path: '/?name=John%20Doe&age=50'.
What is the best way to achieve this? query- a simple hash of the string → {string, number}.
source
share