PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

HttpRequest::setBody

(PECL pecl_http >= 1.5.0)

HttpRequest::setBodySet request body to send, overwriting previously set request body.

Description

bool HttpRequest::setBody ([ string $request_body_data ] )

Set request body to send, overwriting previously set request body.

Parameters

request_body_data

The request body to overwrite the existing request body with.

Caution

Ensure that a Content-Type is specified in the request body.

Return Values

Returns TRUE on success or FALSE on failure.

Notes

Caution

This method was previously available as HttpRequest::setRawPostData().

See Also

PHP Manual