wenpeng / Curl
Licence: mit
一个轻量级的 PHP 网络操作类, 基于 Curl 封装并实现了 Get | Post | Upload | Download 等常用方法。
Stars: ✭ 132
Labels
Projects that are alternatives of or similar to Curl
React Native Vdebug
React-Native 调试工具,支持Console终端、Network导出cURL,可视化Response,Retry cURL。
Stars: ✭ 124 (-6.06%)
Mutual labels: curl
Easylogger
An ultra-lightweight(ROM<1.6K, RAM<0.3k), high-performance C/C++ log library. | 一款超轻量级(ROM<1.6K, RAM<0.3k)、高性能的 C/C++ 日志库
Stars: ✭ 1,968 (+1390.91%)
Mutual labels: lightweight
Walkman
Write HTTP requests in Org mode and replay them at will using cURL
Stars: ✭ 120 (-9.09%)
Mutual labels: curl
Liblightmodbus
A cross-platform, lightweight Modbus RTU library
Stars: ✭ 121 (-8.33%)
Mutual labels: lightweight
Electron Global
One Electron instance for multiple apps
Stars: ✭ 129 (-2.27%)
Mutual labels: lightweight
React Select Me
Fast 🐆. Lightweight 🐜. Configurable 🐙. Easy to use 🦄. Give it a shot 👉🏼
Stars: ✭ 119 (-9.85%)
Mutual labels: lightweight
Nano
Lightweight, facility, high performance golang based game server framework
Stars: ✭ 1,888 (+1330.3%)
Mutual labels: lightweight
Alien
A lightweight and fast http router from outer space
Stars: ✭ 115 (-12.88%)
Mutual labels: lightweight
Ttfb.sh
Measures time-to-first-byte in seconds, for single or multiple URLs. Can calculate fastest, slowest & median TTFB values, and optionally log all response headers. Uses curl and the calculation `%{time_starttransfer} - %{time_appconnect}` which doesn't include any connection overhead, to better approximate devtool’s TTFB figure.
Stars: ✭ 123 (-6.82%)
Mutual labels: curl
Splitties
A collection of hand-crafted extensions for your Kotlin projects.
Stars: ✭ 1,945 (+1373.48%)
Mutual labels: lightweight
Arare
Lightweight curried functional programming library
Stars: ✭ 127 (-3.79%)
Mutual labels: lightweight
关于
PHP-Curl是一个轻量级的网络操作类,实现GET、POST、UPLOAD、DOWNLOAD常用操作,支持方法链写法
需求
对低版本做了向下支持,但建议使用 PHP 5.3 +
安装
composer require wenpeng/curl
use Wenpeng\Curl\Curl;
示例
$curl = new Curl;
或者
$curl = Curl::init();
GET:
$curl->url(目标网址);
POST:
$curl->post(变量名, 变量值)->post(多维数组)->url(目标网址);
UPLOAD:
$curl->post(多维数组)->file($_FILE字段, 本地路径, 文件类型, 原始名称)->url(目标网址);
DOWNLOAD:
$curl->url(文件地址)->save(保存路径);
配置
参考:http://php.net/manual/en/function.curl-setopt.php
$curl->set('CURLOPT_选项', 值)->post(多维数组)->url(目标网址);
自动重试
// 出错自动重试N次(默认0)
$curl->retry(3)->post(多维数组)->url(目标网址);
结果
// 任务结果状态
if ($curl->error()) {
echo $curl->message();
} else {
// 任务进程信息
$info = $curl->info();
// 任务结果内容
$content = $curl->data();
}
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].