igfs/kernel/helpers/RESTClient.php

21 lines
379 B
PHP
Raw Normal View History

2024-11-18 16:04:57 +03:00
<?php
namespace kernel\helpers;
use http\Client;
class RESTClient
{
public static function request(string $url, string $method = 'GET')
{
$client = new \GuzzleHttp\Client();
return $client->request($method, $url, [
'headers' => [
'Authorization' => 'Bearer ' . $_ENV['MODULE_SHOP_TOKEN']
]
]);
}
}