承接 kiwfy/request-service-php 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

kiwfy/request-service-php

最新稳定版本:6.0.0

Composer 安装命令:

composer require kiwfy/request-service-php

包简介

PHP library using Guzzle base to send request to any services. Good to use in microservice architecture

README 文档

README

Latest Version codecov CI Build Downloads Old Downloads PRs Welcome Packagist License (custom server)

PHP library using Guzzle base to send request to any services. Good to use in microservice architecture

Installation

Release 6.0.0 Requires PHP 8.2

Release 5.0.0 Requires PHP 8.1

Release 4.0.0 Requires PHP 7.4

Release 3.0.0 Requires PHP 7.3

Release 2.0.0 Requires PHP 7.2

Release 1.0.0 Requires PHP 7.1

The recommended way to install is through Composer.

composer require not-empty/request-service-php-lib

Usage

Requesting json

use RequestService\Request;
$config = [
	'your-service' => [
		'url' => 'https://jsonplaceholder.typicode.com',
	],
];
$sample = new Request($config);
$response = $sample->sendRequest(
	'your-service',
	'GET',
	'todos/1'
);
var_dump($response);

Requesting stream

use RequestService\Request;
$config = [
	'your-service' => [
		'url' => 'https://developer.marvel.com/',
		'json' => false,
	],
];
$sample = new Request($config);
$header = [
	'stream' => true,
];
$response = $sample->sendRequest(
	'your-service',
	'GET',
	'docs',
	$header
);
var_dump($response);

if you want an environment to run or test it, you can build and install dependences like this

docker build --build-arg PHP_VERSION=8.2-cli -t not-empty/request-service-php-lib:php82 -f contrib/Dockerfile .

Access the container

docker run -v ${PWD}/:/var/www/html -it not-empty/request-service-php-lib:php82 bash

Verify if all dependencies is installed

composer install --no-dev --prefer-dist

and run

php sample/request-sample.php
php sample/request-image-sample.php

Development

Want to contribute? Great!

The project using a simple code. Make a change in your file and be careful with your updates! Any new code will only be accepted with all validations.

To ensure that the entire project is fine:

First you need to building a correct environment to install all dependences

docker build --build-arg PHP_VERSION=8.2-cli -t not-empty/request-service-php-lib:php82 -f contrib/Dockerfile .

Access the container

docker run -v ${PWD}/:/var/www/html -it not-empty/request-service-php-lib:php82 bash

Install all dependences

composer install --dev --prefer-dist

Run all validations

composer check

Not Empty Foundation - Free codes, full minds

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-3.0-only
  • 更新时间: 2020-08-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固