Options
All
  • Public
  • Public/Protected
  • All
Menu

A reply instance, for sending headers and data in an HTTP response.

Hierarchy

  • FastifyReply
    • Reply

Index

Properties

context: FastifyContext<unknown>
log: FastifyLoggerInstance
raw: ServerResponse
request: FastifyRequest<RouteGenericInterface, Server, IncomingMessage, unknown, FastifyLoggerInstance>
sent: boolean
server: FastifyInstance<Server, IncomingMessage, ServerResponse, FastifyLoggerInstance>
statusCode: number

Methods

  • callNotFound(): void
  • Returns void

  • code(statusCode: number): FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>
  • Parameters

    • statusCode: number

    Returns FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>

  • getHeader(key: string): undefined | string
  • Parameters

    • key: string

    Returns undefined | string

  • getHeaders(): {}
  • Returns {}

    • [key: string]: number | string | string[] | undefined
  • getResponseTime(): number
  • Returns number

  • hasHeader(key: string): boolean
  • Parameters

    • key: string

    Returns boolean

  • header(key: string, value: any): FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>
  • Parameters

    • key: string
    • value: any

    Returns FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>

  • headers(values: {}): FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>
  • Parameters

    • values: {}
      • [key: string]: any

    Returns FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>

  • hijack(): FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>
  • Returns FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>

  • redirect(statusCode: number, url: string): FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>
  • redirect(url: string): FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>
  • Parameters

    • statusCode: number
    • url: string

    Returns FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>

  • Parameters

    • url: string

    Returns FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>

  • removeHeader(key: string): void
  • Parameters

    • key: string

    Returns void

  • send(payload?: unknown): FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>
  • Parameters

    • Optional payload: unknown

    Returns FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>

  • serialize(payload: any): string
  • Parameters

    • payload: any

    Returns string

  • serializer(fn: ((payload: any) => string)): FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>
  • Parameters

    • fn: ((payload: any) => string)
        • (payload: any): string
        • Parameters

          • payload: any

          Returns string

    Returns FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>

  • status(statusCode: number): FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>
  • Parameters

    • statusCode: number

    Returns FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>

  • then(fulfilled: (() => void), rejected: ((err: Error) => void)): void
  • Parameters

    • fulfilled: (() => void)
        • (): void
        • Returns void

    • rejected: ((err: Error) => void)
        • (err: Error): void
        • Parameters

          • err: Error

          Returns void

    Returns void

  • type(contentType: string): FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>
  • Parameters

    • contentType: string

    Returns FastifyReply<Server, IncomingMessage, ServerResponse, RouteGenericInterface, unknown>

Generated using TypeDoc