vertx / io.vertx.ext.web.handler / BodyHandler

BodyHandler

interface BodyHandler : Handler<RoutingContext>

A handler which gathers the entire request body and sets it on the RoutingContext.

It also handles HTTP file uploads and can be used to limit body sizes.

Author
Tim Fox

Properties

DEFAULT_BODY_LIMIT

static val DEFAULT_BODY_LIMIT: Long

Default max size for a request body. -1 means unlimited

DEFAULT_DELETE_UPLOADED_FILES_ON_END

static val DEFAULT_DELETE_UPLOADED_FILES_ON_END: Boolean

Default value of whether uploaded files should be removed after handling the request

DEFAULT_MERGE_FORM_ATTRIBUTES

static val DEFAULT_MERGE_FORM_ATTRIBUTES: Boolean

Default value of whether form attributes should be merged into request params

DEFAULT_UPLOADS_DIRECTORY

static val DEFAULT_UPLOADS_DIRECTORY: String

Default uploads directory on server for file uploads

Functions

create

open static fun create(): BodyHandler

Create a body handler with defaults

open static fun create(uploadDirectory: String): BodyHandler

Create a body handler and use the given upload directory.

setBodyLimit

abstract fun setBodyLimit(bodyLimit: Long): BodyHandler

Set the maximum body size -1 means unlimited

setDeleteUploadedFilesOnEnd

abstract fun setDeleteUploadedFilesOnEnd(deleteUploadedFilesOnEnd: Boolean): BodyHandler

Set whether uploaded files should be removed after handling the request

setMergeFormAttributes

abstract fun setMergeFormAttributes(mergeFormAttributes: Boolean): BodyHandler

Set whether form attributes will be added to the request parameters

setUploadsDirectory

abstract fun setUploadsDirectory(uploadsDirectory: String): BodyHandler

Set the uploads directory to use