Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Properties

defaultCharset?: string

Specify the default character set for the text content if the charset is not specified in the Content-Type header of the request. Defaults to utf-8.

inflate?: boolean

When set to true, then deflated (compressed) bodies will be inflated; when false, deflated bodies are rejected. Defaults to true.

limit?: string | number

Controls the maximum request body size. If this is a number, then the value specifies the number of bytes; if it is a string, the value is passed to the bytes library for parsing. Defaults to '100kb'.

type?: string | string[] | ((req: IncomingMessage) => any)

The type option is used to determine what media type the middleware will parse

Methods

  • verify(req: IncomingMessage, res: ServerResponse<IncomingMessage>, buf: Buffer, encoding: string): void
  • The verify option, if supplied, is called as verify(req, res, buf, encoding), where buf is a Buffer of the raw request body and encoding is the encoding of the request.

    Parameters

    • req: IncomingMessage
    • res: ServerResponse<IncomingMessage>
    • buf: Buffer
    • encoding: string

    Returns void