HTTP in PHP, Part 1: The Request

Posted in PHP and Zend Framework on Wednesday, the 13th of January, 2010.

When I wrote about HTTP for php|architect magazine, one of the topics that I ended up having to skim over for wordcount reasons was that of how to work with HTTP from within PHP.

So here's a quick overview of how to make and manipulate HTTP requests using PHP. I'll hopefully follow this up in due course with a counterpart post dealing with HTTP responses.

Comments

Posted by BisonTech on Friday, the 1st of October, 2010.

Not work the referer:
$client->setConfig(
array(
'useragent' => 'Nokia N95',
'referer' => 'http://pointbeing.net/',
));

for change the Referer you must use setHeader method, like this:

$client->setHeaders('Referer', 'http://www.pointbeing.net/');

bye :D

Enter your comment: