From 3bbb74b3eee914bdc8bd504ac1ad70d6de551960 Mon Sep 17 00:00:00 2001 From: Francisco Presencia Date: Mon, 24 Apr 2017 01:17:48 +0200 Subject: [PATCH] docs: added note about arrays (#964) Added note about arrays being returned as JSON. --- docs/api/response.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api/response.md b/docs/api/response.md index 751f740..2253cf9 100644 --- a/docs/api/response.md +++ b/docs/api/response.md @@ -118,7 +118,7 @@ so you can make a correction. - `string` written - `Buffer` written - `Stream` piped - - `Object` json-stringified + - `Object` || `Array` json-stringified - `null` no content response If `response.status` has not been set, Koa will automatically set the status to `200` or `204`. @@ -156,7 +156,7 @@ app.use(function * (next) { #### Object - The Content-Type is defaulted to application/json. + The Content-Type is defaulted to application/json. This includes plain objects `{ foo: 'bar' }` and arrays `['foo', 'bar']`. ### response.get(field)