From d42bcd14194661da92a5387b350bdd2ae0c9c8ac Mon Sep 17 00:00:00 2001 From: Julian Gojani Date: Wed, 24 Aug 2022 17:45:05 +0200 Subject: [PATCH] Added baseurl --- src/main/de/interaapps/ulole/httpclient/HttpClient.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/de/interaapps/ulole/httpclient/HttpClient.php b/src/main/de/interaapps/ulole/httpclient/HttpClient.php index 6056283..1488d95 100644 --- a/src/main/de/interaapps/ulole/httpclient/HttpClient.php +++ b/src/main/de/interaapps/ulole/httpclient/HttpClient.php @@ -13,17 +13,18 @@ class HttpClient { public static JSONPlus $jsonPlusDefault; private HttpAdapter $adapter; - private string $baseUrl = ""; public JSONPlus $jsonPlus; - public function __construct() { + public function __construct( + private string $baseUrl = "" + ) { } public function request(string $method, string $url): HttpRequest { $this->adapter = HttpClient::$adapterDefault; $this->jsonPlus = HttpClient::$jsonPlusDefault; - $req = new HttpRequest($this, $this->baseUrl . $method, $url); + $req = new HttpRequest($this, $method, $this->baseUrl . $url); $req->headers($this->headers); $req->queries($this->queryParameters); $req->timeout($this->timeout);