From 660a3cd2471c1cb3ee1e505608124125cbc3b620 Mon Sep 17 00:00:00 2001 From: Philipp Date: Wed, 25 Aug 2021 20:46:47 +0200 Subject: [PATCH] Expose IHTTPClient::request() --- src/Network/HTTPClient.php | 2 +- src/Network/IHTTPClient.php | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Network/HTTPClient.php b/src/Network/HTTPClient.php index f4293cd08..eabd5d450 100644 --- a/src/Network/HTTPClient.php +++ b/src/Network/HTTPClient.php @@ -59,7 +59,7 @@ class HTTPClient implements IHTTPClient /** * @throws HTTPException\InternalServerErrorException */ - protected function request(string $method, string $url, array $opts = []): IHTTPResult + public function request(string $method, string $url, array $opts = []): IHTTPResult { $this->profiler->startRecording('network'); $this->logger->debug('Request start.', ['url' => $url, 'method' => $method]); diff --git a/src/Network/IHTTPClient.php b/src/Network/IHTTPClient.php index f7064e1c0..c7d122c8f 100644 --- a/src/Network/IHTTPClient.php +++ b/src/Network/IHTTPClient.php @@ -85,6 +85,17 @@ interface IHTTPClient */ public function get(string $url, array $opts = []); + /** + * Sends a HTTP request to a given url + * + * @param string $method A HTTP request () + * @param string $url Url to send to + * @param array $opts parameters + * + * @return IHTTPResult + */ + public function request(string $method, string $url, array $opts = []); + /** * Send POST request to an URL *