-
Notifications
You must be signed in to change notification settings - Fork 220
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
Body parser/form parser/url encoded parser by default #259
Comments
Thanks for responding @nozomuikuta , take a look at this issue nuxt/nuxt#15730 |
We should probably document this or expose a similar helper, // H3
export async function getRequestFromEvent(event: H3Event) {
const url = new URL(getRequestURL(event))
const method = getMethod(event)
const body = method === "POST" ? await readRawBody(event) : undefined
return new Request(url, { headers: getRequestHeaders(event) as any, method, body })
}
// H3
export async function getFormData(event: H3Event) {
return (await getRequestFromEvent(event)).formData()
} Then you can use |
The new |
Describe the feature
Every time I have to include some kind of form parsing it increases the development time by hours. Each time I have to find npm and find a package that works. It would be nice to have this parsed by default and exposed somewhere as a getter so developers don't have to worry about anything
Additional information
The text was updated successfully, but these errors were encountered: