优化函数签名

This commit is contained in:
耗子 2025-06-09 05:40:42 +08:00
parent 5f0e973770
commit a4698d67c6
No known key found for this signature in database
GPG Key ID: C964D7226D045DAA

View File

@ -396,17 +396,17 @@ function clearDirectory($dir): bool
* 发送 HTTP 请求
*
* @param string $url 请求URL
* @param mixed $data 请求数据,可以是字符串或数组,数组将自动根据请求方法及传入的 Content-Type 序列化
* @param string|null $referer 请求的 Referer
* @param array|null $cookie 请求的 Cookie
* @param array|null $headers 其他自定义请求头
* @param mixed $data 请求数据,可以是字符串或数组,数组将自动根据请求方法及传入的 Content-Type 序列化
* @param string|null $referer 请求的 Referer
* @param array|null $cookie 请求的 Cookie
* @param array|null $headers 其他自定义请求头
* @param bool $proxy 是否使用代理
* @param string|null $method 请求方法,默认为 GET POST如果存在请求数据
* @param int $timeout 请求超时时间,默认为 10
* @return array 包含 HTTP 状态码、重定向 URL、响应头和响应体的数组
* @throws Exception
*/
function http_request($url, $data = null, $referer = null, $cookie = null, $headers = null, $proxy = false, $method = null, $timeout = 10)
function http_request($url, $data = null, $referer = null, $cookie = null, $headers = null, $proxy = false, $method = null, $timeout = 10): array
{
$options = [
'timeout' => $timeout,