UNPKG

@nova-ts/core

Version:

A serverside framework used to build scalable application

21 lines (19 loc) 641 B
/** * Decorator to bind a method parameter to a specific HTTP header in the request. * * Use this to extract values like `Authorization`, `User-Agent`, etc. * * Example usage: * ```ts * @GetMapping('/secure') * secureEndpoint(@RequestHeader('authorization') authHeader: string) { * // authHeader contains the value of req.headers['authorization'] * } * ``` * * @param {string} name - The name of the header to retrieve (case-insensitive). * @returns {ParameterDecorator} The parameter decorator function. * @author Inbanithi107 */ declare function RequestHeader(key: string): ParameterDecorator; export { RequestHeader };