Answers for "geting request header in loopback4"

1

geting request header in loopback4

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;
  }
}
Posted by: Guest on October-21-2021

Browse Popular Code Answers by Language