HttpRequest
PHP Manual

HttpRequest::setHeaders

(PECL pecl_http >= 0.12.0)

HttpRequest::setHeadersSet headers

说明

public bool HttpRequest::setHeaders ([ array $headers ] )

Set request header name/value pairs.

参数

headers

an associative array as parameter containing header name/value pairs; if empty or omitted, all previously set headers will be unset

返回值

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


HttpRequest
PHP Manual