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
How to get POST params? #719
Comments
@xunjianxiang you can get your POST params like this: ctx.request.body // your POST params
ctx.params // URL params, like :id |
I get ctx.request.body but it's undefined |
@hanxu317317 you need a body parser. Google for koa-bodyparser and/or koa-body. |
thank you, it's ok |
yeah |
yes |
Hi, does body parser required some extra config, I still get an empty array using both ctx.request.body and ctx.params. Im also using koa-joi-router. I want to access the verification code from params. thx! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
koa: v2.0.0
koa-router: v7.0.1
Everything seems all right, but I can't find the post params.
Insert the code:
The
data
will be print correctly!I don't want to use this approach.
Have any good Suggestions?
The text was updated successfully, but these errors were encountered: