note 83839 modified in function.httprequest-setheaders by tularis

From: Date: Mon, 19 Dec 2011 19:44:18 +0000
Subject: note 83839 modified in function.httprequest-setheaders by tularis
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-185164@lists.php.net to get a copy of this message
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(array('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(array('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 --was-- 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 http://php.net/manual/en/function.httprequest-setheaders.php

« previous php.notes (#185164) next »