-
Notifications
You must be signed in to change notification settings - Fork 576
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Update koa's integration guide for body parsing #3670
fix: Update koa's integration guide for body parsing #3670
Conversation
|
Thanks @aryascripts ! |
@ardatan NP! I wasn't sure if the documentation would be released with no changeset, but let me know if anything is needed for that :) |
✅ Benchmark Results
|
Why
I saw that these docs were updated recently, and this is also something we were struggling with in one of our applications. I noticed that we do need to use
ctx.request
, but the documentation was a bit confusing - it mentioned:(two negatives)
koa-body (most popular) by default, it does:
patchNode: false
= not place parsed body inctx.req
(Node.jsIncomingMessage
type)patchKoa: true
= does place parsed body inctx.request
(Koa's Request, abstraction of Node's request)From the investigation, it's known that we must use the
ctx.request
object that does have the parsed body.Without koa-body, either one works.
What