Skip to content

Commit 8ddab48

Browse files
authored
docs: Document response status with empty body (#1445)
Co-authored-by: Marc-Aurèle DARCHE <[email protected]>
1 parent 7deedb2 commit 8ddab48

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

docs/api/response.md

+10
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,16 @@ __NOTE__: don't worry too much about memorizing these strings,
9090
if you have a typo an error will be thrown, displaying this list
9191
so you can make a correction.
9292

93+
Since `response.status` default is set to `404`, to send a response
94+
without a body and with a different status is to be done like this:
95+
96+
```js
97+
ctx.response.status = 200;
98+
99+
// Or whatever other status
100+
ctx.response.status = 204;
101+
```
102+
93103
### response.message
94104

95105
Get response status message. By default, `response.message` is

0 commit comments

Comments
 (0)