Get raw body next js 13 app directory
Answered
German Spitz posted this in #help-forum
German SpitzOP
I am trying to secure a GitHub webhook, and for that I need the raw body of the request. In the pages directory this is supposed to work:
Error:
What is the equivalent to this in the app directory?
export const config = {
api: {
bodyParser: false,
},
};Error:
export const config in ... is deprecated. Please change runtime property to segment export config. See https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-configWhat is the equivalent to this in the app directory?
4 Replies
European sprat
use
await request.text()European sprat
const textBody = await request.text()Answer
German SpitzOP
ðŸ‘