-
Notifications
You must be signed in to change notification settings - Fork 16
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 request body with customize token? #5
Comments
You can pass the tokens: [
{ token: ':body', replacement: function() { return ctx.request.body } }
] |
But it seems can't use as Koa-middleware way,
because ctx is not defined here. |
I have just added a new syntax to allow replacing token with tokens: [
{ token: ':body', content: function(ctx) { return ctx.request.body } }
] You can upgrade your package to |
Wonderful. Now I use |
It not work, it save the first time request param, and return it everytime |
Which should be fix by this #8 PR. |
The code support custom_tokens, but if the replacement is something like
ctx.request.body
,I can't pass the option just like:
because ctx is not defined here.
I can use a wrapper, but is there any simple way to solve this problem?
The text was updated successfully, but these errors were encountered: