Interface AddContentTypeParser<RawServer, RawRequest, RouteGeneric, SchemaCompiler, TypeProvider>

Natively, Fastify only supports 'application/json' and 'text/plain' content types. The default charset is utf-8. If you need to support different content types, you can use the addContentTypeParser API. The default JSON and/or plain text parser can be changed.

interface AddContentTypeParser<RawServer, RawRequest, RouteGeneric, SchemaCompiler, TypeProvider> {
    (contentType, opts, parser): void;
    (contentType, parser): void;
    <parseAs>(contentType, opts, parser): void;
}

Type Parameters