BodyHandler

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

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

package

Default

Methods

__construct

__construct() 

Create a body handler with defaults

create( $arg0 = null) : \io\vertx\jphp\ext\web\handler\BodyHandler
static

create()

Create a body handler setting if it should handle file uploads

param $handleFileUploads [boolean] true if files upload should be handled create($handleFileUploads)

Create a body handler and use the given upload directory.

param $uploadDirectory [string] the uploads directory create($uploadDirectory)

Arguments

$arg0

boolean | string

Response

\io\vertx\jphp\ext\web\handler\BodyHandler

the body handler

Something has happened, so handle it.

handle( $arg0) : void

Arguments

$arg0

RoutingContext

Set the maximum body size -1 means unlimited

setBodyLimit( $arg0) : $this

Arguments

$arg0

integer

Response

$this

reference to this for fluency

Set whether uploaded files should be removed after handling the request

setDeleteUploadedFilesOnEnd( $arg0) : $this

Arguments

$arg0

boolean

Response

$this

reference to this for fluency

Set whether file uploads will be handled

setHandleFileUploads( $arg0) : $this

Arguments

$arg0

boolean

Response

$this

reference to this for fluency

Set whether form attributes will be added to the request parameters

setMergeFormAttributes( $arg0) : $this

Arguments

$arg0

boolean

Response

$this

reference to this for fluency

Pre-allocate the body buffer according to the value parsed from content-length header.

setPreallocateBodyBuffer( $arg0) : $this

The buffer is capped at 64KB

Arguments

$arg0

boolean

Response

$this

reference to this for fluency

Set the uploads directory to use

setUploadsDirectory( $arg0) : $this

Arguments

$arg0

string

Response

$this

reference to this for fluency

Constants

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

DEFAULT_BODY_LIMIT
var

php文件只是为了写代码方便,常量的实际值请参考原java文件

Default uploads directory on server for file uploads

DEFAULT_UPLOADS_DIRECTORY
var

php文件只是为了写代码方便,常量的实际值请参考原java文件

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

DEFAULT_MERGE_FORM_ATTRIBUTES
var

php文件只是为了写代码方便,常量的实际值请参考原java文件

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

DEFAULT_DELETE_UPLOADED_FILES_ON_END
var

php文件只是为了写代码方便,常量的实际值请参考原java文件

Default value of whether to pre-allocate the body buffer size according to the content-length HTTP request header

DEFAULT_PREALLOCATE_BODY_BUFFER
var

php文件只是为了写代码方便,常量的实际值请参考原java文件