Skip to content

Latest commit

 

History

History
25 lines (18 loc) · 602 Bytes

README.md

File metadata and controls

25 lines (18 loc) · 602 Bytes

发起异步http请求的一个php扩展

依赖libevent库

install

phpize
./configure --with-php-config=/usr/local/php/bin/php-config --with-libevent=/usr/local/libevent/ --enable-ahttp

branch for_php55 for php5.5

branch master for php7

demo

$obj = new ahttp();
$obj->set_time_out(1000);
$obj->get('http://www.google.com');
$obj->post('http://example.com', array('data' => 'aaaaaa'));
$obj->get('http://example.com', array('header' => array('User-agent' => 'ahttp')));
$obj->wait_reply();
$arr = $obj->result();

返回值的顺序按发起的返回