【发布时间】:2019-01-25 01:46:56
【问题描述】:
我需要在我的拦截器上获取请求正文,然后它才能到达我的控制器:
import { Injectable, NestInterceptor, ExecutionContext, HttpException, HttpStatus } from '@nestjs/common';
import { Observable } from 'rxjs';
import { map } from 'rxjs/operators';
@Injectable()
export class ExcludeNullInterceptor implements NestInterceptor {
intercept(context: ExecutionContext, call$: Observable<any>): Observable<any> {
// How can I get the request body here?
// Need to be BEFORE the Controller exec
}
}
【问题讨论】:
标签: javascript node.js nestjs