HttpRequest
PHP Manual

HttpRequest::setBody

(PECL pecl_http >= 1.5.0)

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

说明

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

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

参数

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.

返回值

成功时返回 TRUE, 或者在失败时返回 FALSE

注释

Caution

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

参见


HttpRequest
PHP Manual