title: response.writeHead and response.end in NodeJs
body: <pre><code>var https = require('https');
  var fs = require('fs');
  
  var options = {
    key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
    cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem')
  };
  
  https.createServer(options, function (req, res) {
    res.writeHead(200);
    res.end("hello world\n");
  }).listen(8000);
  </code></pre>
  
  <ol>
  <li>Can anyone explain me why do we call the <code>writeHead</code> and <code>end</code>
  method in createServer method.</li>
  <li>What is the main purpose of options object passed in createServer
  method.</li>
  </ol>