Describe the feature
Would be nice I think if h3 had a helper function like getPayload
Would work just like getQuery and readBody but would work for both depending on the request method and also include the route params
Here is a proof of concept for getPayload as a utility function:
https://stackblitz.com/edit/github-dbe8gu?file=server%2Futils%2Findex.ts
(uses Nuxt getRouterParams... not sure what that would be in h3)
Would also be great to have a getValidatedPayload version that works like the query and body counterparts.
Additional information
Describe the feature
Would be nice I think if h3 had a helper function like
getPayloadWould work just like
getQueryandreadBodybut would work for both depending on the request method and also include the route paramsHere is a proof of concept for
getPayloadas a utility function:https://stackblitz.com/edit/github-dbe8gu?file=server%2Futils%2Findex.ts
(uses Nuxt getRouterParams... not sure what that would be in h3)
Would also be great to have a
getValidatedPayloadversion that works like the query and body counterparts.Additional information