title: Node JS POST method with authorization
body: <p>I can't find anything in the docs on exactly how to do this.</p>
  
  <p><a href="http://nodejs.org/api.html#request-method-149" rel="nofollow noreferrer">http://nodejs.org/api.html#request-method-149</a></p>
  
  <p>I need to make a Node js POST with authorization something similar to this in ruby:</p>
  
  <pre><code>url = URI.parse('http://www.example.com/todo.cgi')
      req = Net::HTTP::Post.new(url.path)
      req.basic_auth 'jack', 'pass'
  </code></pre>
  
  <p>I am trying to essentially do this:</p>
  
  <pre><code>var client = http.createClient(80, 'http://api.foo.com');
    var rq = client.request('POST', '/path/', 
    {
      'authorization' : [account, password]
      'key': value,
      etc....
    }
  </code></pre>