h3 icon indicating copy to clipboard operation
h3 copied to clipboard

getPayload helper

Open danielkellyio opened this issue 1 year ago • 2 comments

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 avatar Jun 21 '24 16:06 danielkellyio

@danielkellyio Would you like to work on a PR? Seems fairly simple but useful feature.

pi0 avatar Jun 04 '25 22:06 pi0

@pi0 sure thing! I'll try to work on it some later this week :)

danielkellyio avatar Jun 11 '25 20:06 danielkellyio