定制 isikiyski/fgc_client 二次开发

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

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

isikiyski/fgc_client

Composer 安装命令:

composer require isikiyski/fgc_client

包简介

file_get_contents curlable wrapper

README 文档

README

Wrapper HTTP Client utilising file_get_contents in PHP

Requirements

  • PHP >= 8.0

Installation

composer require isikiyski/fgc_client

Usage

$o = new \Isikiyski\Client\FGCClient('https://some-url');

$o->setHeaders([
    'Authorization' => 'Basic w231313331',
    'x-api-key' => 'rand',
    'Content-Type' => 'application/json',
]);

$payload = ["message" => "test"];

$o->setTimeout(60);

$o->post('', $payload);

if ($ec = $o->getErrorCode()) {
    echo $ec . PHP_EOL;
}
if ($em = $o->getErrorMessage()) {
    echo $em . PHP_EOL;
}

echo $o->getResponseHeaders() . PHP_EOL;
echo $o->getHttpStatusCode() . PHP_EOL;
echo $o->getRawResponse() . PHP_EOL;
//
// ....
//

Notes

Using this client instead of regular curl will be faster IF you destroy the curl handle on each request. However, reusing the curl handle resource will yield better results.

Strongly suggest using this client in Swoole's coroutines - it yields 92% better performance than regular curl WITH reusing the curl handle resource.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2023-01-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固