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