Here is node.js document about response.writeHead(statusCode[, statusMessage][, headers])
I don't understand "statusCode[, statusMessage][, headers]",
Is it stand for one params or more?
if one, why
writeHead(200,
followed a comma?if two, why
statusCode[, statusMessage][, headers]
without a comma?
where means I can pass json?
Is there any document show about these param's rule?
Example:
const body = 'hello world';
response.writeHead(200, {
'Content-Length': Buffer.byteLength(body),
'Content-Type': 'text/plain' });