add ctx.query docs to clarify lack of nested object support
This commit is contained in:
parent
5bbe362294
commit
22c035bbea
1 changed files with 7 additions and 4 deletions
11
docs/api.md
11
docs/api.md
|
@ -296,7 +296,11 @@ this.type = 'png';
|
||||||
|
|
||||||
### ctx.query
|
### ctx.query
|
||||||
|
|
||||||
Get parsed query-string, for example "color=blue&size=small":
|
Get parsed query-string, returning an empty object when no
|
||||||
|
query-string is present. Note that this getter does _not_
|
||||||
|
support nested parsing.
|
||||||
|
|
||||||
|
For example "color=blue&size=small":
|
||||||
|
|
||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
|
@ -305,11 +309,10 @@ this.type = 'png';
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
__NOTE__: this property returns `{}` when no query-string is present.
|
|
||||||
|
|
||||||
### ctx.query=
|
### ctx.query=
|
||||||
|
|
||||||
Set query-string to the given object.
|
Set query-string to the given object. Note that this
|
||||||
|
setter does _not_ support nested objects.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
this.query = { next: '/login' };
|
this.query = { next: '/login' };
|
||||||
|
|
Loading…
Reference in a new issue