From ea45a97354db18703e2089b7f171e1fa62392751 Mon Sep 17 00:00:00 2001 From: p9x75mskn <3278354422@qq.com> Date: Wed, 8 Jan 2025 20:30:25 +0800 Subject: [PATCH] Update curl.lib.php --- core/curl.lib.php | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/core/curl.lib.php b/core/curl.lib.php index d11b004..eadae31 100644 --- a/core/curl.lib.php +++ b/core/curl.lib.php @@ -7,9 +7,8 @@ namespace LaneWeChat\Core; * Created by Lane. * @Author: lane * @Mail: lixuan868686@163.com - * @Date: 14-1-10 + * @Date: 2014-01-10 * @Time: 下午4:22 - * Mail: lixuan868686@163.com * Website: http://www.lanecn.com */ class Curl @@ -30,8 +29,8 @@ class Curl * @param string $queryUrl 请求的URL * @param array|string $param 参数 * @param string $method 请求方法,默认为'get' - * @param bool $is_json 是否将返回结果解析为JSON,默认为true - * @param bool $is_urlcode 是否对POST参数进行URL编码,默认为true + * @param bool $is_json 是否将返回结果解析为JSON + * @param bool $is_urlcode 是否对参数进行URL编码 * @return bool|mixed 返回请求结果或false */ public static function callWebServer($queryUrl, $param = '', $method = 'get', $is_json = true, $is_urlcode = true) @@ -219,14 +218,4 @@ class Curl return $response; } } -类声明:class Curl 定义了一个名为 Curl 的类,用于简化HTTP请求操作。 -私有静态变量:private static $_ch; 等变量用于存储CURL会话句柄、头部、主体等信息。 -存储数组:private static $_cookie = array(); 等数组用于存储Cookie、选项、URL和Referer等信息。 -callWebServer方法:用于调用外部URL,支持GET和POST请求。根据请求方法调用相应的私有方法,并根据参数决定是否解析为JSON。 -_init方法:初始化CURL会话,设置CURL选项。 -setOption方法:设置CURL选项,传入选项数组。 -_close方法:关闭CURL会话。 -_httpGet方法:发送GET请求,构建查询字符串并设置CURL选项。 -_httpPost方法:发送POST请求,对参数进行URL编码并设置CURL选项。 -_put、_delete、_head方法:分别用于发送PUT、DELETE和HEAD请求,设置相应的CURL选项。 -_execute方法:执行CURL请求,如果发生错误则抛出异常。 \ No newline at end of file +