Skip to content
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 access the Request.Body after ShouldBind*() returns an error ? #1377

Closed
rstrlcpy opened this issue May 30, 2018 · 2 comments
Closed
Labels

Comments

@rstrlcpy
Copy link

To increase log-details I want to put into the log the data, that ShouldBind*() read from Request.Body before fail.

@delphinus
Copy link

Replace c.Request.Body with a wrapped one by io.TeeReader or so.

Or you should use c.ShouldBindBodyWith instead of c.ShouldBind*, and c.Get(gin.BodyBytesKey) to access the original body.

see #1341

@appleboy
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants