getPayload helper
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
- [X] Would you be willing to help implement this feature?
@danielkellyio Would you like to work on a PR? Seems fairly simple but useful feature.
@pi0 sure thing! I'll try to work on it some later this week :)