response.statusMessage

response.statusMessage When using implicit headers (not calling response.writeHead() explicitly), this property controls the status message that will be sent to the client when the headers get flushed. If this is left as undefined then the standard message for the status code will be used. Example: response.statusMessage = 'Not found'; After response header was sent to the client, this property indicates the status message which was sent out.

response.statusCode

response.statusCode When using implicit headers (not calling response.writeHead() explicitly), this property controls the status code that will be sent to the client when the headers get flushed. Example: response.statusCode = 404; After response header was sent to the client, this property indicates the status code which was sent out.

response.setTimeout()

response.setTimeout(msecs, callback) msecs <Number> callback <Function> Sets the Socket's timeout value to msecs. If a callback is provided, then it is added as a listener on the 'timeout' event on the response object. If no 'timeout' listener is added to the request, the response, or the server, then sockets are destroyed when they time out. If you assign a handler on the request, the response, or the server's 'timeout' events, then it is your responsibility to handle timed

response.setHeader()

response.setHeader(name, value) Sets a single header value for implicit headers. If this header already exists in the to-be-sent headers, its value will be replaced. Use an array of strings here if you need to send multiple headers with the same name. Example: response.setHeader('Content-Type', 'text/html'); or response.setHeader('Set-Cookie', ['type=ninja', 'language=javascript']); Attempting to set a header field name or value that contains invalid characters will result in a TypeError bei

response.sendDate

response.sendDate When true, the Date header will be automatically generated and sent in the response if it is not already present in the headers. Defaults to true. This should only be disabled for testing; HTTP requires the Date header in responses.

response.removeHeader()

response.removeHeader(name) Removes a header that's queued for implicit sending. Example: response.removeHeader('Content-Encoding');

response.headersSent

response.headersSent Boolean (read-only). True if headers were sent, false otherwise.

response.getHeader()

response.getHeader(name) Reads out a header that's already been queued but not sent to the client. Note that the name is case insensitive. This can only be called before headers get implicitly flushed. Example: var contentType = response.getHeader('content-type');

response.finished

response.finished Boolean value that indicates whether the response has completed. Starts as false. After response.end() executes, the value will be true.

response.end()

response.end([data][, encoding][, callback]) This method signals to the server that all of the response headers and body have been sent; that server should consider this message complete. The method, response.end(), MUST be called on each response. If data is specified, it is equivalent to calling response.write(data, encoding) followed by response.end(callback). If callback is specified, it will be called when the response stream is finished.