docs: update docs on res.status and res.body

This commit is contained in:
Jonathan Ong 2014-01-04 02:05:05 -08:00
parent e8c0e19b92
commit aa50c8ba7a

View file

@ -12,7 +12,7 @@
### 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=
@ -90,9 +90,7 @@ so you can make a correction.
### res.body
Get response body. When `res.body` is `null` and `res.status` is still
200 it is considered a 404. This is to prevent the developer from manually
specifying `this.status = 200` on every response.
Get response body.
### res.body=
@ -104,6 +102,8 @@ so you can make a correction.
- `Object` json-stringified
- `null` no content response
If `res.status` has been set, Koa will automatically set the status to `200` or `204`.
#### String
The Content-Type is defaulted to text/html or text/plain, both with