-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
何平
committed
Mar 18, 2024
1 parent
ce8c87d
commit 74cbae3
Showing
11 changed files
with
66 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
/** | ||
* This file is part of Cloud-Admin project. | ||
* | ||
* @link https://www.cloud-admin.jayjay.cn | ||
* @document https://wiki.cloud-admin.jayjay.cn | ||
* @license https://github.com/swow-cloud/swow-admin/blob/master/LICENSE | ||
*/ | ||
$ch = \curl_init(); | ||
|
||
// 设置 URL 及其他适当的选项 | ||
\curl_setopt($ch, CURLOPT_URL, 'https://localhost:9501'); | ||
\curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_2_0); | ||
\curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | ||
\curl_setopt($ch, CURLOPT_HTTPHEADER, ['Connection: keep-alive']); | ||
|
||
// 获取响应内容 | ||
$response = \curl_exec($ch); | ||
|
||
// 检查是否有错误发生 | ||
if (\curl_errno($ch)) { | ||
// 如果 curl_exec() 返回 false,就表示发生了错误 | ||
echo 'cURL 错误: ' . \curl_error($ch); | ||
} else { | ||
// 正常处理响应内容 | ||
echo '响应内容: ' . $response; | ||
} | ||
|
||
// 检查是否发送了 HTTP/2 请求 | ||
if (\curl_getinfo($ch, CURLINFO_HTTP_VERSION) == CURL_HTTP_VERSION_2_0) { | ||
echo "HTTP/2 request sent\n"; | ||
} else { | ||
echo "HTTP/2 request not sent\n"; | ||
} | ||
|
||
// 关闭 cURL 资源,并释放系统资源 | ||
\curl_close($ch); | ||
|
||
// 输出响应结果 | ||
echo $response; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters