mggflow / msvc-api
Send requests to laravel microservice
v1.0.0
2021-10-30 10:44 UTC
Requires
- guzzlehttp/guzzle: 7.4.x-dev
This package is auto-updated.
Last update: 2024-12-12 21:52:48 UTC
README
About
This package makes wrapping to fast and easy send requests to laravel microservice API from Server side code.
Usage
To install:
composer require mggflow/msvc-api
Example:
use MGGFLOW\Microservices\Api;
$msvcName = "msvc_name";
$apiUrl = "https://url.to/api";
// Create instance of API.
$api = new Api($msvcName, $apiUrl);
// Send request to action "hello" of microservice with param "name".
$resp = $api->hello(["name" => "John"])->send();
// Returns json decoded response or false.
var_dump($resp);