From 8ddab48cbdbca1e6d1cc8c3ddae45491db524d51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Aur=C3=A8le=20DARCHE?= <152407+madarche@users.noreply.github.com> Date: Sat, 18 Apr 2020 16:54:46 +0200 Subject: [PATCH] docs: Document response status with empty body (#1445) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Marc-Aurèle DARCHE --- docs/api/response.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/api/response.md b/docs/api/response.md index 5e5b43e47..4ad2f6631 100644 --- a/docs/api/response.md +++ b/docs/api/response.md @@ -90,6 +90,16 @@ __NOTE__: don't worry too much about memorizing these strings, if you have a typo an error will be thrown, displaying this list so you can make a correction. + Since `response.status` default is set to `404`, to send a response + without a body and with a different status is to be done like this: + +```js +ctx.response.status = 200; + +// Or whatever other status +ctx.response.status = 204; +``` + ### response.message Get response status message. By default, `response.message` is