定制 corealg/curl 二次开发

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

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

corealg/curl

Composer 安装命令:

composer require corealg/curl

包简介

Curl helper for php.

README 文档

README

Install

Via Composer

$ composer require corealg/curl

Quick Start and Examples

# GET Request

use CoreAlg\Curl;

$curl = new Curl();
$response = $curl->get('https://www.lipsum.com/');
var_dump($response);
# GET Request With Custom Options

use CoreAlg\Curl;

$curl = new Curl();

$options = [
    CURLOPT_HTTPHEADER => [
        "Content-Type: application/json",
        "Authorization: Bearer TOKEN"
    ]
    // You can add options as many as you need
];

$response = $curl->get('https://www.lipsum.com/', $options);
var_dump($response);
# Get Content Length Via GET Request

use CoreAlg\Curl;

$curl = new Curl();

// Set custom options and send it to getFileSize function as second argument [OPTIONAL]
// $options = [
//     CURLOPT_HTTPHEADER => [
//         "Content-Type: application/json",
//         "Authorization: Bearer TOKEN"
//     ]
//     // You can add options as many as you need
// ];

$response = $curl->getFileSize("https://dummyimage.com/250/ffffff/000000");
var_dump($response);
# POST Request

use CoreAlg\Curl;

$curl = new Curl();

$data = [
    // Your data array
];

$options = [];

$response = $curl->post('https://www.lipsum.com/', $data, $options);
var_dump($response)/

// NOTE: $data and $options both are optional parameter

// NOTE: $data array will be converted to json before execute request, so you do not need to worry about it just feel free to make and pass your $data array
# PATCH Request

use CoreAlg\Curl;

$curl = new Curl();

$data = [
    // Your data array
];

$options = [];

$response = $curl->patch('https://www.lipsum.com/', $data, $options);
var_dump($response);

// NOTE: $data and $options both are optional parameter

// NOTE: $data array will be converted to json before execute request, so you do not need to worry about it just feel free to make and pass your $data array

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-12-13

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固