企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
# curl curl组件提供远程请求操作,支持文件的上传和下载。 其他产品也可以使用该组件,请登录 [GITHUB](https://github.com/houdunwang/curl) 查看源代码与说明文档。 [TOC] # 开始使用 #### 发起请求 ``` Curl::get('http://www.hdphp.com'); ``` #### 下载文件 ``` $d = Curl::get('http://www.hdphp.com/soft/hdphp.zip'); file_put_contents('a.zip',$d); ``` #### 提交POST数据 ``` $data = [ 'mobile' => $mobile, 'content' => $content ]; Curl::post( 'http://www.hdphp.com', $data ); ``` #### 获取状态码 ``` Curl::getCode(); ```