async function bootstrap() {
const app = await NestFactory.create<NestExpressApplication>(AppModule, {
bodyParser: false,
rawBody: true,
});
await app.listen(5000);
}
bootstrap();
@Post()
create(@Req() req: RawBodyRequest<Request>) {
const raw = req.rawBody; // returns a `Buffer`.
console.log(raw); // it be undefined
}
When i need to get EUC-KR Encoding Data, i need to use bodyparser: false, rawBody: true
But I can't read req.rawBody data, it will be undefind.
My code is wrong?
i use this version
"@nestjs/common": "^9.0.0",
"@nestjs/core": "^9.0.0",
"@nestjs/platform-express": "^9.0.0",