From e860f4ee28e056e313a27668cb6cc6577b5407f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Aur=C3=A8le=20DARCHE?= Date: Sat, 18 Apr 2020 16:38:41 +0200 Subject: [PATCH] Document response status with empty body --- 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