From aa50c8ba7a83d933abe41f0c6940bcf5b23499a1 Mon Sep 17 00:00:00 2001 From: Jonathan Ong Date: Sat, 4 Jan 2014 02:05:05 -0800 Subject: [PATCH] docs: update docs on res.status and res.body --- docs/api/response.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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