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?
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.
I have some path and query fields mapped to well-defined types like
int
andstring
. However, I want to read the request body as[]byte
or ideally, asmap[string][]string
. It seemsc.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?