123456789101112131415161718192021222324252627 |
- <?php
- namespace addons\shopro\library;
- use GuzzleHttp\Client;
- use GuzzleHttp\RequestOptions;
- use Psr\Http\Client\ClientInterface;
- use Psr\Http\Message\RequestInterface;
- use Psr\Http\Message\ResponseInterface;
- class HttpClient extends Client implements ClientInterface
- {
- public function sendRequest(RequestInterface $request): ResponseInterface
- {
- $options[RequestOptions::SYNCHRONOUS] = true;
- $options[RequestOptions::ALLOW_REDIRECTS] = false;
- $options[RequestOptions::HTTP_ERRORS] = false;
- return $this->sendAsync($request, $options)->wait();
- }
- }
|