-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
ctx.Request().body only fetch once #1297
Comments
Hello @wyanlord, this is a net/http (comes from Body.Read method which consumes data this is basic golang knowedge) behavior.
data, err := ioutil.ReadAll(ctx.Request().Body)
if err != nil {
return err
}
ctx.Request().Body = ioutil.NopCloser(bytes.NewBuffer(data)) Hope that helped. |
I hope I can keep it in the iris.context structure after form param parsed. |
when post
And I had used |
…ctx.FormValues' and on the new 'ctx.GetBody' method helper as requested at: #1297
…ctx.FormValues' and on the new 'ctx.GetBody' method helper as requested at: kataras#1297 Former-commit-id: c6a52681c940681ac85a330465d38a078186a8a1
I get it in middleware. And I cannot get it in handler again.
The text was updated successfully, but these errors were encountered: