The documentation for the method writes, "If data is specified, it is equivalent to calling response.write(data, encoding) followed by response.end()."
And the doc describes the response.write(chunk, [encoding]) as,
chunk can be a string or a buffer. If chunk is a string, the second parameter specifies how to encode it into a byte stream. By default the encoding is 'utf8'.
I still do not get how to use this method given the description. Can someone give a very simple example of a set of working parameters in this case?