HttpRequest
PHP Manual

HttpRequest::setBody

(PECL pecl_http >= 1.5.0)

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

Descrição

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

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

Parâmetros

request_body_data

The request body to overwrite the existing request body with.

Cuidado

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

Valor Retornado

Retorna TRUE em caso de sucesso ou FALSE em caso de falha.

Notas

Cuidado

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

Veja Também


HttpRequest
PHP Manual