downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

HttpRequest::addPostFields> <HttpRequest::addCookies
Last updated: Fri, 13 Nov 2009

view this page in

HttpRequest::addHeaders

(PECL pecl_http >= 0.10.0)

HttpRequest::addHeadersヘッダを追加する

説明

public bool HttpRequest::addHeaders ( array $headers )

リクエストヘッダの 名前/値 の組み合わせを追加します。

パラメータ

headers

追加するヘッダの 名前/値 の組み合わせを含む連想配列。

返り値

成功した場合に TRUE を、失敗した場合に FALSE を返します。



add a note add a note User Contributed Notes
HttpRequest::addHeaders
pal
04-Nov-2008 12:20
If like me you were wondering why your POST request is going out with the header 'Expect: 100-continue' set, it is being added by libcurl.

This can only be noticed when using HttpRequest::getRawRequestMessage() and not HttpRequest::getHeaders(), or of course tcpdump or similar.

To remove this header you can do the following;

$r->addHeaders(array('Expect' => ''));

Note this behaviour has also been reported in http://au.php.net/manual/en/function.curl-setopt.php#82418

HttpRequest::addPostFields> <HttpRequest::addCookies
Last updated: Fri, 13 Nov 2009
 
 
show source | credits | sitemap | contact | advertising | mirror sites