docs: added note about arrays (#964)
Added note about arrays being returned as JSON.
This commit is contained in:
parent
2da3dd49fa
commit
3bbb74b3ee
1 changed files with 2 additions and 2 deletions
|
@ -118,7 +118,7 @@ so you can make a correction.
|
||||||
- `string` written
|
- `string` written
|
||||||
- `Buffer` written
|
- `Buffer` written
|
||||||
- `Stream` piped
|
- `Stream` piped
|
||||||
- `Object` json-stringified
|
- `Object` || `Array` json-stringified
|
||||||
- `null` no content response
|
- `null` no content response
|
||||||
|
|
||||||
If `response.status` has not been set, Koa will automatically set the status to `200` or `204`.
|
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
|
#### 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)
|
### response.get(field)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue