HttpRequest
PHP 手册

HttpRequest::setContentType

(PECL pecl_http >= 0.10.0)

HttpRequest::setContentTypeSet content type

说明

public bool HttpRequest::setContentType ( string $content_type )

Set the content type the post request should have.

参数

content_type

the content type of the request (primary/secondary)

返回值

Returns TRUE on success, or FALSE if the content type does not seem to contain a primary and a secondary part.


HttpRequest
PHP 手册