Skip to content

Latest commit

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

GET请求

$http = newHttpClient();
$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 = newHttpClient(); $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

21 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages