title: Node.js has no method 'sendHeader'
body: <p>Node.js has no method 'sendHeader'</p>
  
  <p>Installation copy is from git clone git://github.com/joyent/node.git</p>
  
  <p>Is install inside ubunti lucid server as Amazon EC2 AMI file.</p>
  
  <p>The simple say hello via command output is working.</p>
  
  <p>But, when output to browser, it fail to works.</p>
  
  <p>Guys, any idea to fix it?</p>
  
  <p>I hope to use node.js, but seems it is not ready for production usage yet.</p>
  
  <pre><code>ubuntu@ip-10-129-31-63:~/Desktop/node/test3$ node hello_world_server.js
  Server running at http://localhost:8080/
  
  /home/ubuntu/Desktop/node/test3/hello_world_server.js:5
      response.sendHeader(200, {"Content-Type": "text/html"});
               ^
  TypeError: Object #&lt;ServerResponse&gt; has no method 'sendHeader'
      at Server.&lt;anonymous&gt; (/home/ubuntu/Desktop/node/test3/hello_world_server.js:5:14)
      at Server.emit (events.js:45:17)
      at HTTPParser.onIncoming (http.js:1081:12)
      at HTTPParser.onHeadersComplete (http.js:87:31)
      at Socket.ondata (http.js:980:22)
      at Socket._onReadable (net.js:654:27)
      at IOWatcher.onReadable [as callback] (net.js:156:10)
  ubuntu@ip-10-129-31-63:~/Desktop/node/test3$ node -v
  v0.5.0-pre
  </code></pre>
  
  <p>Code to run</p>
  
  <pre><code>var sys = require('sys'),
     http = require('http');
  
  http.createServer(function (req, res) {
  
    setTimeout(function () {
  
      res.writeHead(200, {'Content-Type': 'text/html'});
  
      res.write('&lt;br/&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Hello World!&lt;/strong&gt;');
  
      res.end();
  
    }, 2000);
  
  }).listen(8000);
  
  sys.puts('Server running at http://127.0.0.1:8000/');
  </code></pre>