# Decorator RawBodyParams

Decorator operation input private
Module
import { RawBodyParams } from "@tsed/platform/platform-params/src/decorators/bodyParams"
Source/packages/platform/platform-params/src/decorators/bodyParams.ts

# Overview

function RawBodyParams(): ParameterDecorator;

# Description

RawBodyParams return the value from request.body (opens new window) as a Buffer.

# Example

@Controller('/')
class MyCtrl {
   @Post('/')
   create(@RawBodyParams() body: Buffer) {
      console.log('Entire body', body.toString('utf8'));
   }
}
1
2
3
4
5
6
7

Other topics