rkusa / koa-formidable

Formidable middleware for Koa
MIT License
25 stars 2 forks source link

Put form data in this.req.body or this.request.body? #1

Closed iliakan closed 10 years ago

iliakan commented 10 years ago

From #koajs IRC:

<iliakan> what is the better place to parse POST: this.req.body OR this.request.body ?
<jongleberry> i put still in .request
<jongleberry> because that is scoped to the koa app
iliakan commented 10 years ago

P.S. jongleberry is one of #koajs devs.

rkusa commented 10 years ago

Good point! Since Koa does not modify Node's request (not like express) I should not do it, too. The separation between Node's and Koa's request was not that clear in the early versions of Koa, which is why I've put it into req in the first place. Anyway, I agree that body should be added to request.