docs: update docs on res.status and res.body
This commit is contained in:
parent
e8c0e19b92
commit
aa50c8ba7a
1 changed files with 4 additions and 4 deletions
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
### res.status
|
### res.status
|
||||||
|
|
||||||
Get response status.
|
Get response status. By default, `res.status` is not set unlike node's `res.statusCode` which defaults to `200`.
|
||||||
|
|
||||||
### res.status=
|
### res.status=
|
||||||
|
|
||||||
|
@ -90,9 +90,7 @@ so you can make a correction.
|
||||||
|
|
||||||
### res.body
|
### res.body
|
||||||
|
|
||||||
Get response body. When `res.body` is `null` and `res.status` is still
|
Get response body.
|
||||||
200 it is considered a 404. This is to prevent the developer from manually
|
|
||||||
specifying `this.status = 200` on every response.
|
|
||||||
|
|
||||||
### res.body=
|
### res.body=
|
||||||
|
|
||||||
|
@ -104,6 +102,8 @@ so you can make a correction.
|
||||||
- `Object` json-stringified
|
- `Object` json-stringified
|
||||||
- `null` no content response
|
- `null` no content response
|
||||||
|
|
||||||
|
If `res.status` has been set, Koa will automatically set the status to `200` or `204`.
|
||||||
|
|
||||||
#### String
|
#### String
|
||||||
|
|
||||||
The Content-Type is defaulted to text/html or text/plain, both with
|
The Content-Type is defaulted to text/html or text/plain, both with
|
||||||
|
|
Loading…
Reference in a new issue