Function readRequestBody

  • Parses a request body according to its Content-Type.

    Supports JSON, plain/HTML text, and form data (URL-encoded or multipart); anything else is read as raw text. An empty body resolves to null.

    Parameters

    • request: any

      The incoming request.

    Returns Promise<any>

    The parsed body (object for JSON/form, string for text, or null).

    Throws

    If the body cannot be parsed.

Generated using TypeDoc