Home > Article > Web Front-end > Instructions for using the http.response.writeHead method in node.js_node.js
Method description:
Send response headers to the requesting client.
This function can only be called once in a request. If not called, a response header will be automatically generated.
Grammar:
Receive parameters:
statusCode HTTP status code, such as 200 (request successful), 404 (not found), etc.
reasonPhrase
headers An object similar to an associative array, representing each attribute of the response header
Example: