21 lines
		
	
	
		
			379 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			379 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?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']
 | 
						|
            ]
 | 
						|
        ]);
 | 
						|
    }
 | 
						|
 | 
						|
} |