28 lines
645 B
PHP
28 lines
645 B
PHP
<?php
|
|
|
|
namespace App\Lib\Request;
|
|
|
|
use App\Interface\Test\Decorator\HttpClientInterface;
|
|
use GuzzleHttp\Client;
|
|
use GuzzleHttp\Exception\GuzzleException;
|
|
use Psr\Http\Message\ResponseInterface;
|
|
|
|
class GuzzleHttpClient implements HttpClientInterface
|
|
{
|
|
/**
|
|
* @param string $method
|
|
* @param string $url
|
|
* @param array $options
|
|
* @return ResponseInterface
|
|
* @throws GuzzleException
|
|
*/
|
|
public function request(
|
|
string $method,
|
|
string $url,
|
|
array $options = []
|
|
): ResponseInterface
|
|
{
|
|
$client = new Client();
|
|
return $client->request($method, $url, $options);
|
|
}
|
|
} |