Hierarchy

  • BodyParserOptions

Properties

detectJSON?: ((ctx: IMidwayKoaContext) => boolean)

Type declaration

enable?: boolean
enableTypes?: string[]

parser will only parse when request type hits enableTypes, default is ['json', 'form'].

encoding?: string

requested encoding. Default is utf-8 by co-body

extendTypes?: {
    form?: string | string[];
    json?: string | string[];
    text?: string | string[];
}

support extend types

Type declaration

  • Optional form?: string | string[]
  • Optional json?: string | string[]
  • Optional text?: string | string[]
formLimit?: string

limit of the urlencoded body. If the body ends up being larger than this limit a 413 error code is returned. Default is 56kb

jsonLimit?: string

limit of the json body. Default is 1mb

onerror?: ((err: Error, ctx: IMidwayKoaContext) => void)

Type declaration

strict?: boolean

when set to true, JSON parser will only accept arrays and objects. Default is true

textLimit?: string

limit of the text body. Default is 1mb.

xmlLimit?: string

limit of the xml body. Default is 1mb.

Generated using TypeDoc