1
0
mirror of https://github.com/OpenXE-org/OpenXE.git synced 2025-03-05 22:49:48 +01:00
2021-05-21 08:49:41 +02:00

45 lines
1.3 KiB
PHP

<?php
declare(strict_types=1);
namespace Xentral\Components\HttpClient;
use Xentral\Components\HttpClient\Exception\TransferErrorExceptionInterface;
use Xentral\Components\HttpClient\Request\ClientRequestInterface;
use Xentral\Components\HttpClient\Response\ServerResponseInterface;
use Xentral\Components\HttpClient\Stream\StreamInterface;
use Xentral\Components\HttpClient\Uri\UriInterface;
interface HttpClientInterface
{
/**
* @param string $method HTTP method
* @param string|UriInterface $uri URI
* @param array $headers Request headers
* @param string|null|resource|StreamInterface $body Request body
* @param string $version Protocol version
*
* @throws TransferErrorExceptionInterface
*
* @return ServerResponseInterface
*/
public function request(
$method,
$uri,
array $headers = [],
$body = null,
$version = '1.1'
): ServerResponseInterface;
/**
* @param ClientRequestInterface $request
* @param RequestOptions|null $options
*
* @return ServerResponseInterface
*/
public function sendRequest(
ClientRequestInterface $request,
RequestOptions $options = null
): ServerResponseInterface;
}