Interface FastifyReply<RawServer, RawRequest, RawReply, RouteGeneric, ContextConfig, SchemaCompiler, TypeProvider, ReplyType> interface FastifyReply < RawServer , RawRequest , RawReply , RouteGeneric , ContextConfig , SchemaCompiler , TypeProvider , ReplyType > { context : FastifyReplyContext < ContextConfig > ; elapsedTime : number ; log : FastifyBaseLogger ; raw : RawReply ; request : FastifyRequest < RouteGeneric , RawServer , RawRequest , SchemaCompiler , TypeProvider , unknown , FastifyBaseLogger , ResolveFastifyRequestType < TypeProvider , SchemaCompiler , RouteGeneric > > ; sent : boolean ; server : FastifyInstance < RawServerDefault , IncomingMessage , ServerResponse < IncomingMessage > , FastifyBaseLogger , FastifyTypeProviderDefault > ; statusCode : number ; trailer : ( ( key ,
fn ) => FastifyReply < RawServer , RawRequest , RawReply , RouteGeneric , ContextConfig , SchemaCompiler , TypeProvider , UndefinedToUnknown < KeysOf < RouteGeneric [ "Reply" ] > extends never ? ResolveReplyFromSchemaCompiler < TypeProvider , SchemaCompiler > : RouteGeneric [ "Reply" ] > > ) ; callNotFound ( ) : void ; code < Code > ( statusCode ) : FastifyReply < RawServer , RawRequest , RawReply , RouteGeneric , ContextConfig , SchemaCompiler , TypeProvider , ResolveReplyTypeWithRouteGeneric < RouteGeneric [ "Reply" ] , Code , SchemaCompiler , TypeProvider > > ; compileSerializationSchema ( schema ,
httpStatus ? ,
contentType ? ) : ( ( payload ) => string ) ; getHeader ( key ) : undefined | string | number | string [] ; getHeaders ( ) : Record < HttpHeader , undefined | string | number | string [] > ; getResponseTime ( ) : number ; getSerializationFunction ( httpStatus ,
contentType ? ) : undefined | ( ( payload ) => string ) ; getSerializationFunction ( schema ) : undefined | ( ( payload ) => string ) ; hasHeader ( key ) : boolean ; hasTrailer ( key ) : boolean ; header ( key ,
value ) : FastifyReply < RawServer , RawRequest , RawReply , RouteGeneric , ContextConfig , SchemaCompiler , TypeProvider , UndefinedToUnknown < KeysOf < RouteGeneric [ "Reply" ] > extends never ? ResolveReplyFromSchemaCompiler < TypeProvider , SchemaCompiler > : RouteGeneric [ "Reply" ] > > ; headers ( values ) : FastifyReply < RawServer , RawRequest , RawReply , RouteGeneric , ContextConfig , SchemaCompiler , TypeProvider , UndefinedToUnknown < KeysOf < RouteGeneric [ "Reply" ] > extends never ? ResolveReplyFromSchemaCompiler < TypeProvider , SchemaCompiler > : RouteGeneric [ "Reply" ] > > ; hijack ( ) : FastifyReply < RawServer , RawRequest , RawReply , RouteGeneric , ContextConfig , SchemaCompiler , TypeProvider , UndefinedToUnknown < KeysOf < RouteGeneric [ "Reply" ] > extends never ? ResolveReplyFromSchemaCompiler < TypeProvider , SchemaCompiler > : RouteGeneric [ "Reply" ] > > ; redirect ( statusCode ,
url ) : FastifyReply < RawServer , RawRequest , RawReply , RouteGeneric , ContextConfig , SchemaCompiler , TypeProvider , UndefinedToUnknown < KeysOf < RouteGeneric [ "Reply" ] > extends never ? ResolveReplyFromSchemaCompiler < TypeProvider , SchemaCompiler > : RouteGeneric [ "Reply" ] > > ; redirect ( url ) : FastifyReply < RawServer , RawRequest , RawReply , RouteGeneric , ContextConfig , SchemaCompiler , TypeProvider , UndefinedToUnknown < KeysOf < RouteGeneric [ "Reply" ] > extends never ? ResolveReplyFromSchemaCompiler < TypeProvider , SchemaCompiler > : RouteGeneric [ "Reply" ] > > ; removeHeader ( key ) : FastifyReply < RawServer , RawRequest , RawReply , RouteGeneric , ContextConfig , SchemaCompiler , TypeProvider , UndefinedToUnknown < KeysOf < RouteGeneric [ "Reply" ] > extends never ? ResolveReplyFromSchemaCompiler < TypeProvider , SchemaCompiler > : RouteGeneric [ "Reply" ] > > ; removeTrailer ( key ) : FastifyReply < RawServer , RawRequest , RawReply , RouteGeneric , ContextConfig , SchemaCompiler , TypeProvider , UndefinedToUnknown < KeysOf < RouteGeneric [ "Reply" ] > extends never ? ResolveReplyFromSchemaCompiler < TypeProvider , SchemaCompiler > : RouteGeneric [ "Reply" ] > > ; send ( payload ? ) : FastifyReply < RawServer , RawRequest , RawReply , RouteGeneric , ContextConfig , SchemaCompiler , TypeProvider , UndefinedToUnknown < KeysOf < RouteGeneric [ "Reply" ] > extends never ? ResolveReplyFromSchemaCompiler < TypeProvider , SchemaCompiler > : RouteGeneric [ "Reply" ] > > ; serialize ( payload ) : string | Buffer | ArrayBuffer ; serializeInput ( input ,
schema ,
httpStatus ? ,
contentType ? ) : string ; serializeInput ( input ,
httpStatus ,
contentType ? ) : unknown ; serializer ( fn ) : FastifyReply < RawServer , RawRequest , RawReply , RouteGeneric , ContextConfig , SchemaCompiler , TypeProvider , UndefinedToUnknown < KeysOf < RouteGeneric [ "Reply" ] > extends never ? ResolveReplyFromSchemaCompiler < TypeProvider , SchemaCompiler > : RouteGeneric [ "Reply" ] > > ; status < Code > ( statusCode ) : FastifyReply < RawServer , RawRequest , RawReply , RouteGeneric , ContextConfig , SchemaCompiler , TypeProvider , ResolveReplyTypeWithRouteGeneric < RouteGeneric [ "Reply" ] , Code , SchemaCompiler , TypeProvider > > ; then ( fulfilled ,
rejected ) : void ; type ( contentType ) : FastifyReply < RawServer , RawRequest , RawReply , RouteGeneric , ContextConfig , SchemaCompiler , TypeProvider , UndefinedToUnknown < KeysOf < RouteGeneric [ "Reply" ] > extends never ? ResolveReplyFromSchemaCompiler < TypeProvider , SchemaCompiler > : RouteGeneric [ "Reply" ] > > ; } Defined in node_modules/fastify/types/reply.d.ts:33 Properties context Defined in node_modules/fastify/types/reply.d.ts:44 elapsed Time elapsed Time : number
Defined in node_modules/fastify/types/reply.d.ts:45 log Defined in node_modules/fastify/types/reply.d.ts:46 raw Defined in node_modules/fastify/types/reply.d.ts:43 request Defined in node_modules/fastify/types/reply.d.ts:47 sent sent : boolean
Defined in node_modules/fastify/types/reply.d.ts:52 server Defined in node_modules/fastify/types/reply.d.ts:48 status Code status Code : number
Defined in node_modules/fastify/types/reply.d.ts:51 trailer Type declaration ( key , fn ) : FastifyReply < RawServer , RawRequest , RawReply , RouteGeneric , ContextConfig , SchemaCompiler , TypeProvider , UndefinedToUnknown < KeysOf < RouteGeneric [ "Reply" ] > extends never ? ResolveReplyFromSchemaCompiler < TypeProvider , SchemaCompiler > : RouteGeneric [ "Reply" ] > > Parameters key : string fn : ( ( reply , payload ) => Promise < string > ) | ( ( reply , payload , done ) => void ) Defined in node_modules/fastify/types/reply.d.ts:79 Methods call Not Found call Not Found ( ) : void Returns void Defined in node_modules/fastify/types/reply.d.ts:64 code code < Code > ( statusCode ) : FastifyReply < RawServer , RawRequest , RawReply , RouteGeneric , ContextConfig , SchemaCompiler , TypeProvider , ResolveReplyTypeWithRouteGeneric < RouteGeneric [ "Reply" ] , Code , SchemaCompiler , TypeProvider > > Defined in node_modules/fastify/types/reply.d.ts:49 compile Serialization Schema compile Serialization Schema ( schema , httpStatus ? , contentType ? ) : ( ( payload ) => string ) Parameters schema : { [key : string ]: unknown ; } Optional httpStatus : string Optional contentType : string Returns ( ( payload ) => string ) ( payload ) : string Parameters payload : { [key : string ]: unknown ; } Returns string Defined in node_modules/fastify/types/reply.d.ts:75 get Header get Header ( key ) : undefined | string | number | string [] Returns undefined | string | number | string [] Defined in node_modules/fastify/types/reply.d.ts:56 get Headers get Headers ( ) : Record < HttpHeader , undefined | string | number | string [] > Returns Record < HttpHeader , undefined | string | number | string [] > Defined in node_modules/fastify/types/reply.d.ts:57 get Response Time get Response Time ( ) : number Returns number Defined in node_modules/fastify/types/reply.d.ts:68 get Serialization Function get Serialization Function ( httpStatus , contentType ? ) : undefined | ( ( payload ) => string ) Parameters httpStatus : string Optional contentType : string Returns undefined | ( ( payload ) => string ) Defined in node_modules/fastify/types/reply.d.ts:73 get Serialization Function ( schema ) : undefined | ( ( payload ) => string ) Parameters schema : { [key : string ]: unknown ; } Returns undefined | ( ( payload ) => string ) Defined in node_modules/fastify/types/reply.d.ts:74 has Header has Header ( key ) : boolean Returns boolean Defined in node_modules/fastify/types/reply.d.ts:59 has Trailer has Trailer ( key ) : boolean Returns boolean Defined in node_modules/fastify/types/reply.d.ts:83 redirect redirect ( statusCode , url ) : FastifyReply < RawServer , RawRequest , RawReply , RouteGeneric , ContextConfig , SchemaCompiler , TypeProvider , UndefinedToUnknown < KeysOf < RouteGeneric [ "Reply" ] > extends never ? ResolveReplyFromSchemaCompiler < TypeProvider , SchemaCompiler > : RouteGeneric [ "Reply" ] > > Parameters statusCode : number url : string Defined in node_modules/fastify/types/reply.d.ts:61 redirect ( url ) : FastifyReply < RawServer , RawRequest , RawReply , RouteGeneric , ContextConfig , SchemaCompiler , TypeProvider , UndefinedToUnknown < KeysOf < RouteGeneric [ "Reply" ] > extends never ? ResolveReplyFromSchemaCompiler < TypeProvider , SchemaCompiler > : RouteGeneric [ "Reply" ] > > Defined in node_modules/fastify/types/reply.d.ts:62 serialize serialize ( payload ) : string | Buffer | ArrayBuffer Defined in node_modules/fastify/types/reply.d.ts:71 serialize Input serialize Input ( input , schema , httpStatus ? , contentType ? ) : string Parameters input : { [key : string ]: unknown ; } schema : { [key : string ]: unknown ; } Optional httpStatus : string Optional contentType : string Returns string Defined in node_modules/fastify/types/reply.d.ts:76 serialize Input ( input , httpStatus , contentType ? ) : unknown Parameters input : { [key : string ]: unknown ; } httpStatus : string Optional contentType : string Returns unknown Defined in node_modules/fastify/types/reply.d.ts:77 status status < Code > ( statusCode ) : FastifyReply < RawServer , RawRequest , RawReply , RouteGeneric , ContextConfig , SchemaCompiler , TypeProvider , ResolveReplyTypeWithRouteGeneric < RouteGeneric [ "Reply" ] , Code , SchemaCompiler , TypeProvider > > Defined in node_modules/fastify/types/reply.d.ts:50 then then ( fulfilled , rejected ) : void Parameters fulfilled : ( ( ) => void ) rejected : ( ( err ) => void ) Returns void Defined in node_modules/fastify/types/reply.d.ts:78
FastifyReply is an instance of the standard http or http2 reply types. It defaults to http.ServerResponse, and it also extends the relative reply object.