unjs/h3: ⚡️ Minimal H(TTP) framework built for high performance and portability (github.com)
readBody与readRawBody
export default defineEventHandler(async (event) => {
const body1 = await readBody(event)
const body2 = await readRawBody(event)
const body3 = await readRawBody(event, 'utf8')
console.log('body1', body1, typeof body1)
console.log('body2', body2, typeof body2)
console.log('body3', body3, typeof body3)
});
正文完
发表至: NuxtJS
2023-09-03