From e614990852d73effb455b9da1b3d33c1d1ebafa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pekka=20Lepp=C3=A4nen?= Date: Tue, 16 Sep 2014 14:49:38 +0300 Subject: [PATCH] Added sendStatus() to express.Response Added as described in documentation: http://expressjs.com/4x/api.html#res.sendStatus --- express/express.d.ts | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/express/express.d.ts b/express/express.d.ts index 17c4ff36a6..cf5014e82b 100644 --- a/express/express.d.ts +++ b/express/express.d.ts @@ -424,7 +424,22 @@ declare module "express" { * @param code */ status(code: number): Response; - + + /** + * Set the response HTTP status code to `statusCode` and send its string representation as the response body. + * @link http://expressjs.com/4x/api.html#res.sendStatus + * + * Examples: + * + * res.sendStatus(200); // equivalent to res.status(200).send('OK') + * res.sendStatus(403); // equivalent to res.status(403).send('Forbidden') + * res.sendStatus(404); // equivalent to res.status(404).send('Not Found') + * res.sendStatus(500); // equivalent to res.status(500).send('Internal Server Error') + * + * @param code + */ + sendStatus(code: number): Send; + /** * Set Link header field with the given `links`. *