-
Website
http://www.phpfour.com/blog -
Original page
http://www.phpfour.com/blog/2008/01/20/php-http-class/ -
Subscribe
All Comments -
Community
-
Top Commenters
-
robskils
1 comment · 1 points
-
joshsharp
1 comment · 1 points
-
nirjhar
1 comment · 1 points
-
Nhm Tanveer Hossain Khan
1 comment · 1 points
-
cubanhenry5
1 comment · 1 points
-
-
Popular Threads
yea its a good idea if you add this to orchid framework. :)
cool man :)
You are doing excellent. Keep up the good work. Godspeed.
Excellent structure, easy to use and ???????? documentation.
the cURL require a website need longer time then fsockect.is it?
with allow redirect set to true if i call a page with status code 302 i can't read the headers of destination page, i read only the headers of first page.
it's normal?
can you help me?
Thanks
ciao
riccardo
It is quite helpful in php4 and php5. Love how it degrades automatically if there is no CURL. Have you though of supporting stream wrappers?
into it and will update the source if needed. Thanks
$http->addCookie('logged_in_user' , '747');--snip--
if ($this->status == '302' && $this->redirect == TRUE)
--snip--
Thanks for this class. It definetly makes code simple. Please see my code below(just used your example with little tweaks).
I have couple of questions:
1) We have special chars in password. Can i use it directly.
2) We have SSO authentication. After authenticating it will forward to index.jsp page. When I use the below code, even though I specify userId/pswd, it is not authenticating. It is stopping at the login page. Can you please guide me how to come over this. Thanks.
$http = new Http();
$http->useCurl(false);
$http->setMethod('GET');
$http->addParam('user_name', 'test.id');
$http->addParam('password', 'test!!pwd');
$http->followRedirects(true);
//$http->setReferrer('https://www.test.com/suite/portal/index.jsp');
$http->execute('https://www.test.com/suite/portal/index.jsp');
echo ($http->error) ? $http->error : $http->result;