fireworkteam/curl 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

fireworkteam/curl

最新稳定版本:v1.0.0

Composer 安装命令:

composer require fireworkteam/curl

包简介

A part of Firework, that controls sending request to rest

README 文档

README

Basic usage

    <?php

    use Firework\Curl\Curl; // Import Curl class
    require __DIR__ . '/../vendor/autoload.php'; // Import composer autoload

    $curl = new Curl(); // Create new Curl class
    $curl->setUrl("https://httpbin.org/post"); // Add Curl url

    $response = $curl->post([
        "name" => "jonn",
        "age" => 25
    ], true);

    print_r($response);

Docs

setUrl()

Set url of the request
Params:

  • $url = url of the request
    $url = "http://example.com/

    $curl->setUrl($url);

setHeaders()

Set headers of the request
Params:

  • $headers = string or array of headers:
    $headers = ["HeaderName:HeaderValue", "HeaderName2:HeaderValue2"]
    $curl->setHeaders($headers);

setCurlSettings()

Set curl settings of the request
Params:

  • $arr = array of settings:
    $arr = [CURLOPT_URL => "http://example.com", CURLOPT_HEADER => false]
    $curl->setCurlSettings($arr);

get()

Send get request to url
Params:

  • $arr = array of request values:
    $arr = ["name" => "john", "age" => 25]
    $curl->get($arr);

post()

Send post request to url
Params:

  • $arr = array of request values:
    $arr = ["name" => "john", "age" => 25]
    $curl->post($arr);

put()

Send put request to url
Params:

  • $arr = array of request values:
    $arr = ["name" => "john", "age" => 25]
    $curl->put($arr);

delete()

Send delete request to url
Params:

  • $arr = array of request values:
    $arr = ["name" => "john", "age" => 25]
    $curl->delete($arr);

patch()

Send patch request to url
Params:

  • $arr = array of request values:
    $arr = ["name" => "john", "age" => 25]
    $curl->patch($arr);

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-10-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固