chocofamilyme/laravel-smart-http

Laravel 的 HTTP 客户端,用于服务间通信

2.0.1 2020-11-25 03:48 UTC

This package is auto-updated.

Last update: 2024-09-25 12:10:14 UTC


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'
    ]   
]);