This project help for sending GET/POST/PUT request easier, being used to crawler. This use fsockopen, curl to execute request. Note: fsockopen is faster also default of the class is use fsockopen
- Author: Phan Thanh Cong
- Contact: ptcong90@gmail.com
- Copyright: (c) 2011 chiplove.9xpro
- Version: 2.4
- Use namespace
- Change two static class methods (readBinary, mimeTye) to protected instance method
- Parser header fixed (wrong typing)
- Re-struct, something edited
- Add some functions, something edited
- Fixed some know bugs (php 5.3)
- Update for picasa API
- Add RawPost var to post request (upload image to picasa)
- Fixed some bugs
- Rewrite class to easy use
- Fixed some bugs
- Mime-type bug on upload file fixed
- Upload multi file
- Fixed some bugs
- Cookie
- Referer
- Proxy (only useCurl)
- SerVersion authentication
- Upload file
$http = new \ChipVN\Http();
$http->setTarget("http://www.yourwebsite.com/");
$http->execute();
print_r($http->getResponseHeaders());
echo $http->getResponseText();
$http = new \ChipVN\Http();
$http->setTarget("http://www.yourwebsite.com/");
$http->setParam(array("fieldname"=> $value));
$http->setMethod('POST');
$http->execute();
echo $http->getResponseText();
$http = new \ChipVN\Http();
$http->useCurl(true);
$http->setTarget("http://www.yourwebsite.com/");
$http->setProxy('proxy_ip:proxy_port');
$http->execute();
echo $http->getResponseText();
$filePath = getcwd().'/abc.jpg';
$http = new \ChipVN\Http();
$http->setTarget("http://www.yourwebsite.com/");
$http->setSubmitMultipart();
$http->setParam(array('fileupload'=>"@$filePath"));
$http->execute();
print_r($http->getResponseHeaders());
echo $http->getResponseText();