📜  在 loopback4 中获取请求标头 - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:15.330000             🧑  作者: Mango

代码示例1
import {inject} from '@loopback/core';
import {get, Request, RestBindings} from '@loopback/rest';

export class SomethingController {
  constructor(@inject(RestBindings.Http.REQUEST) private req: Request) {}

  @get('/something')
  something(): void {
    // Get the headers
    this.req.headers;
  }
}