Download the PHP package chenbool/curl without Composer

On this page you can find all versions of the php package chenbool/curl. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package curl

PHP Curl 网络请求库

version php license

一个轻量级的 PHP 网络操作类,基于 Curl 封装,支持 GET、POST、UPLOAD、DOWNLOAD 等常用操作,采用方法链式调用设计。


📋 目录


✨ 特性

特性 描述
🚀 轻量级 单文件实现,无额外依赖
🔗 链式调用 支持流畅的方法链式操作
📤 文件上传 支持单/多文件上传
📥 文件下载 支持文件下载并保存
🔄 自动重试 请求失败自动重试机制
🔒 SSL支持 支持 HTTPS 请求
⚡ 高性能 基于 cURL 扩展,性能优异

🔧 环境要求

项目 版本
PHP >= 5.3.0
cURL扩展 已安装

📦 安装

方式一:Composer 安装(推荐)

方式二:手动引入


🚀 快速开始


📖 使用示例

🔍 GET 请求

📝 POST 请求

📤 文件上传

📥 文件下载

⚙️ 高级配置

🔄 完整请求流程


📚 API 文档

核心方法

方法 参数 返回值 说明
init() - Curl 静态初始化,获取单例实例
url($url) string $url Curl 设置请求 URL
post($data, $value) array/string $data, string $value Curl 设置 POST 数据
file($field, $path, $type, $name) string... Curl 设置上传文件
save($path) string $path Curl 保存响应到文件
set($option, $value) string $option, mixed $value Curl 设置 cURL 选项
retry($times) int $times Curl 设置失败重试次数

结果方法

方法 返回值 说明
error() int 获取错误码,0 表示无错误
message() string 获取错误信息
data() string 获取响应内容
info() array 获取请求信息(HTTP 状态码等)

cURL 常用选项

选项 默认值 说明
CURLOPT_TIMEOUT 30 请求超时时间(秒)
CURLOPT_CONNECTTIMEOUT 10 连接超时时间(秒)
CURLOPT_SSL_VERIFYPEER false 是否验证 SSL 证书
CURLOPT_RETURNTRANSFER true 返回字符串而非直接输出
CURLOPT_HEADER 0 是否在输出中包含 header
CURLOPT_FOLLOWLOCATION - 是否跟随重定向
CURLOPT_USERAGENT - 设置 User-Agent
CURLOPT_REFERER - 设置 Referer

更多选项请参考 PHP cURL 官方文档


📂 项目结构


🔗 相关链接


📄 许可证

MIT License


👤 作者


如果这个项目对您有帮助,请给个 ⭐ Star 支持一下!


All versions of curl with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package chenbool/curl contains the following files

Loading the files please wait ...