文件下载

下载

    1. <?php
    2. /**
    3. * 下载文件请求示例
    4. */
    5. require dirname(__DIR__) . '/vendor/autoload.php';
    6. use Yurun\Util\HttpRequest;
    7. use Yurun\Util\YurunHttp;
    8. use Yurun\Util\YurunHttp\Handler\Swoole;
    9. $url = 'http://www.baidu.com';
    10. $http = new HttpRequest;
    11. $http->download(__DIR__ . '/save.html', $url);