Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

howorld/HttpClient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

11 Commits

Repository files navigation

GET请求

$http = new HttpClient();
$http->set_header('User-Agent','Mozilla/5.0 (Windows NT 5.1; rv:13.0) Gecko/20100101 Firefox/13.0.1'); 
$http->get('http://www.example.com/'); 
echo $http->get_body(); 

POST请求

$http = new HttpClient(); 
$http->set_header('User-Agent','Mozilla/5.0 (Windows NT 5.1; rv:13.0) Gecko/20100101 Firefox/13.0.1'); 
$data = array( 
	'id'=>1, 
	'name'=>'example' 	
); 
$file = array( 
	'photo'=>'/data/patch/file.jpg' 
); 
$http->post('http://www.example.com/',array($data)[,$file]); 
echo $http->get_body(); 

Cookie支持

$http->set_cookies($cookie); 

代理支持

$http->set_proxy('socks5.example.com:1080',HttpClient::PROXY_SOCKS5,'user','password'); 

About

php使用socket模拟post、get操作,支持http、socket4、5代理

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

Contributors

Languages

  • PHP 100.0%

AltStyle によって変換されたページ (->オリジナル) /