egapool / simple-curl
simple curl php 封装
0.0.2
2017-02-05 05:47 UTC
Requires (Dev)
- phpunit/phpunit: 3.7.*
This package is not auto-updated.
Last update: 2024-09-28 20:20:08 UTC
README
Simple Curl 封装。
可以发送 cookies。因此,它可以用于需要登录的页面请求。
安装
composer require egapool/simple-curl
用法
use Egapool\SimpleCurl\Curl;
require('vendor/autoload.php');
$curl = new Curl();
echo $curl->setUrl('https://google.co.jp')->fire()->getBody();
待办事项
- 由于curl_reset需要PHP5.5以上,所以为5.4以下版本添加替代处理
- 解析响应头部
- 停止使用
Curl::fire,改为使用post和get - 使curl_opt参数更加灵活
- 允许从列表中选择UserAgent