update docs for previous breaking change

This commit is contained in:
TJ Holowaychuk 2014-02-14 09:20:29 -08:00
parent 08149052fa
commit c0e0c7c6aa
1 changed files with 4 additions and 5 deletions

View File

@ -20,10 +20,8 @@ app.use(function *(){
``` ```
Many of the context's accessors and methods simply delegate to their `ctx.request` or `ctx.response` Many of the context's accessors and methods simply delegate to their `ctx.request` or `ctx.response`
equivalents for convenience, and are otherwise identical. equivalents for convenience, and are otherwise identical. For example `ctx.type` and `ctx.length`
In general, getters are delegated to `ctx.request` and setters are delegated to `ctx.response`. delegate to the `response` object, and `ctx.path` and `ctx.method` delegate to the `request`.
For example, `this.length` returns the request's `content-length`, whereas `this.length = 1024` sets the response's `content-length` to `1024`.
If this confuses you, simply use `ctx.request` or `ctx.response` directly.
## API ## API
@ -125,7 +123,6 @@ throw err;
- `ctx.query=` - `ctx.query=`
- `ctx.querystring` - `ctx.querystring`
- `ctx.querystring=` - `ctx.querystring=`
- `ctx.length`
- `ctx.type` - `ctx.type`
- `ctx.host` - `ctx.host`
- `ctx.host=` - `ctx.host=`
@ -153,7 +150,9 @@ throw err;
- `ctx.status` - `ctx.status`
- `ctx.status=` - `ctx.status=`
- `ctx.length=` - `ctx.length=`
- `ctx.length`
- `ctx.type=` - `ctx.type=`
- `ctx.type`
- `ctx.headerSent` - `ctx.headerSent`
- `ctx.redirect()` - `ctx.redirect()`
- `ctx.attachment()` - `ctx.attachment()`