Public Member Functions | |
__construct (array $params, array $uploads, $useBrackets=true) | |
getLength () | |
getBoundary () | |
read ($length) | |
rewind () | |
__toString () | |
Definition at line 38 of file MultipartBody.php.
HTTP_Request2_MultipartBody::__construct | ( | array | $params, |
array | $uploads, | ||
$useBrackets = true |
|||
) |
Constructor. Sets the arrays with POST data.
array | $params | values of form fields set via HTTP_Request2::addPostParameter() |
array | $uploads | file uploads set via HTTP_Request2::addUpload() |
bool | $useBrackets | whether to append brackets to array variable names |
Definition at line 90 of file MultipartBody.php.
HTTP_Request2_MultipartBody::__toString | ( | ) |
Returns the body as string
Note that it reads all file uploads into memory so it is a good idea not to use this method with large file uploads and rely on read() instead.
Definition at line 231 of file MultipartBody.php.
HTTP_Request2_MultipartBody::getBoundary | ( | ) |
Returns the boundary to use in Content-Type header
Definition at line 136 of file MultipartBody.php.
HTTP_Request2_MultipartBody::getLength | ( | ) |
Returns the length of the body to use in Content-Length header
Definition at line 115 of file MultipartBody.php.
HTTP_Request2_MultipartBody::read | ( | $length | ) |
Returns next chunk of request body
integer | $length | Number of bytes to read |
HTTP_Request2_LogicException |
Definition at line 152 of file MultipartBody.php.
HTTP_Request2_MultipartBody::rewind | ( | ) |
Sets the current position to the start of the body
This allows reusing the same body in another request
Definition at line 215 of file MultipartBody.php.