HTTP

http.STATUS_CODES

Look up conventional HTTP reason phrases by numeric status. Do not use the phrase as a protocol contract. Local Node 22.16.0; production target compatibility pending. See https://nodejs.org/download/release/v22.16.0/docs/api/http.html.

Formal Syntax & Structure

nodejs syntaxnodejs
http.STATUS_CODES

Return Value

Object

Property value or protocol concept, not a function return.

Working Example

Example Snippetnodejs
const response={status:201,headers:{'content-type':'application/json'},body:'{"id":3}'};console.log(response.status, response.headers['content-type']);console.log(JSON.parse(response.body).id);
Node.js Reference