Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

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;
  }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #geting #request #header
ADD COMMENT
Topic
Name
2+9 =