public static function get($url, $data = [], $header = [], $expire = 30, $proxy = null)
use Timo\Curl;
$url = 'http://www.timophp.com/';
$res = Curl::get($url);
var_dump($res);
use Timo\Curl;
$url = 'http://www.timophp.com/user/info/';
$vars = [
'uid' => 100,
'timestamp' => time(),
];
Curl::get($url, $vars);
use Timo\Curl;
$url = 'http://www.timophp.com/user/info/';
$vars = [
'uid' => 100,
'timestamp' => time(),
];
$headers = [
'Token' => 'abc123'
];
Curl::get($url, $vars, $headers);
use Timo\Curl;
$url = 'http://www.timophp.com/user/info/';
$vars = [
'uid' => 100,
'timestamp' => time(),
];
Curl::post($url, $vars);
use Timo\Curl;
$url = 'http://www.timophp.com/user/info/';
$vars = [
'uid' => 100,
'timestamp' => time(),
];
$headers = [
'Token' => 'abc123'
];
第四个参数设置请求超时时间
use Timo\Curl;
$url = 'http://www.timophp.com/user/info/';
$vars = [
'uid' => 100,
'timestamp' => time(),
];
Curl::get($url, $vars, [], 10); //设置超时时间为10秒钟
use Timo\Curl;
$proxy = "http://180.169.37.66:8090";
$res = Curl::get($url, $vars, [], 10, $proxy);
var_dump($res);