Skip to content

Commit

Permalink
Added baseurl
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianFun123 committed Aug 24, 2022
1 parent 85b5920 commit d42bcd1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/de/interaapps/ulole/httpclient/HttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d42bcd1

Please sign in to comment.