chocofamilyme / laravel-smart-http
Laravel 的 HTTP 客户端,用于服务间通信
2.0.1
2020-11-25 03:48 UTC
Requires
- php: >= 7.4.0
- chocofamilyme/smart-http: ^1.0.1
- laravel/framework: ^8.2
README
基于库 Smart-Http
要求
- PHP 7.4+
- chocofamilyme/smart-http ^1.0
- laravel ^8.2
安装
composer require chocofamilyme/laravel-smart-http
发布配置
php artisan vendor:publish --provider="Chocofamily\Laravel\SmartHttp\Providers\SmartHttpServiceProvider"
配置
配置文件位于 config/smarthttp.php
有关配置的详细文档 Smart-Http
使用
app('SmartRequest')->send('POST', '/resource', [ 'json' => [ 'name' => 'test' ] ]);
或者使用门面
SmartRequest::send('POST', '/resource', [ 'json' => [ 'name' => 'test' ] ]);