You've already forked qlg.tsgz.moe
Init Repo
This commit is contained in:
17
vendor/swoole/tests/include/lib/curl.php
vendored
Executable file
17
vendor/swoole/tests/include/lib/curl.php
vendored
Executable file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
function curlGet($url)
|
||||
{
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_HEADER, 0);
|
||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
|
||||
//在http 请求头加入 gzip压缩
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept-Encoding: gzip'));
|
||||
//curl返回的结果,采用gzip解压
|
||||
curl_setopt($ch, CURLOPT_ENCODING, "gzip");
|
||||
$output = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
return $output;
|
||||
}
|
Reference in New Issue
Block a user