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

search for in the

HttpRequest::setMethod> <HttpRequest::setCookies
Last updated: Fri, 13 Nov 2009

view this page in

HttpRequest::setHeaders

(PECL pecl_http >= 0.12.0)

HttpRequest::setHeadersİstek başlıklarını belirler

Açıklama

public bool HttpRequest::setHeaders ([ array $başlıklar ] )

İstek başlıklarını isim/değer çiftleri olarak belirler.

Değiştirgeler

başlıklar

Başlık isim/değer çiftlerini içeren bir ilişkisel dizi; boşsa veya belirtilmemişse evvelce atanmış tüm başlıklar tanımsız olur.

Dönen Değerler

Başarı durumunda TRUE, başarısızlık durumunda FALSE döner.



add a note add a note User Contributed Notes
HttpRequest::setHeaders
quickshiftin at gmail dot com
14-Jun-2008 06:29
note: you should not put a colon in the keys of the arrays you pass this method, it will do that for you.  and if you do put colons in the array keys, the resultant headers will have 2 colons beside one another.

so for example,
<?php
$httpRequest
->setHeaders('User-Agent' => 'Mozilla/1.22 (compatible; MSIE 5.01; PalmOS 3.0) EudoraWeb 2');
?>

will result in
User-Agent: Mozilla/1.22 (compatible; MSIE 5.01; PalmOS 3.0) EudoraWeb 2

<?php
$httpRequest
->setHeaders('User-Agent:' => 'Mozilla/1.22 (compatible; MSIE 5.01; PalmOS 3.0) EudoraWeb 2');
?>

will result in
User-Agent:: Mozilla/1.22 (compatible; MSIE 5.01; PalmOS 3.0) EudoraWeb 2

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