diff --git a/docs/api/response.md b/docs/api/response.md index a4978f4..ea31694 100644 --- a/docs/api/response.md +++ b/docs/api/response.md @@ -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