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 read the input body? #79

Open
ashishb opened this issue May 28, 2022 · 1 comment
Open

How to read the input body? #79

ashishb opened this issue May 28, 2022 · 1 comment
Labels
question Further information is requested

Comments

@ashishb
Copy link

ashishb commented May 28, 2022

I have some path and query fields mapped to well-defined types like int and string. However, I want to read the request body as []byte or ideally, as map[string][]string. It seems c.Request.Body is non-empty in middleware but it is empty inside my gin routes wrapped in Fizz. What's the best way to access the body inside the handler?

@wI2L
Copy link
Owner

wI2L commented Aug 18, 2022

What you want to achieve defeat the purpose of tonic/fizz, since the binding is supposed to be done for you. And since the body reader is consumed and closed by the tonic wrapper, it's not possible.

@wI2L wI2L added the question Further information is requested label Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants