定制 athlon1600/php-curl-client 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

athlon1600/php-curl-client

最新稳定版本:v1.2.0

Composer 安装命令:

composer require athlon1600/php-curl-client

包简介

Simple PHP cURL Client

关键字:

README 文档

README

CI PHP Version GitHub License Packagist Downloads (custom server)

PHP Curl Client

Very simple curl client. Easy to use and extend to make it into your own custom HTTP client.

✔️ Supports PHP from version 7.3 to 8.4

Installation

composer require athlon1600/php-curl-client "^1.0"

Examples

use Curl\Client;

$client = new Client();

// returns standardized Response object no matter what
$response = $client->get('https://stackoverflow.com');

// 200
$status = $response->status;

// HTML content
$body = $response->body;

// curl_error() OR null
$error = $response->error;

// CurlInfo instance
$info = $response->info;

Update: $response->info now returns an object that will have an auto-complete on your IDE.

;

Works with POST requests too:

$client->post('http://httpbin.org/post', ['username' => 'bob', 'password' => 'test']);

or you can issue a completely customized request:

$client->request('GET', 'https://www.whatismyip.com/', null, [
    'User-Agent' => 'Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X)'
], [
    CURLOPT_PROXY => '127.0.0.1:8080',
    CURLOPT_TIMEOUT => 10
]);

TODO

  • make PSR-7 and PSR-18 compatible

统计信息

  • 总下载量: 106.2k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 13
  • 点击次数: 4
  • 依赖项目数: 4
  • 推荐数: 0

GitHub 信息

  • Stars: 13
  • Watchers: 2
  • Forks: 8
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固