diff --git a/src/main/client/netcore.client.ftl b/src/main/client/netcore.client.ftl index a112d05a..7d3aee71 100644 --- a/src/main/client/netcore.client.ftl +++ b/src/main/client/netcore.client.ftl @@ -137,4 +137,22 @@ namespace io.fusionauth { return new DefaultRESTClient(host); } } + + public class HttpClientBuilder : IRESTClientBuilder + { + public HttpClient HTTP_CLIENT; + + public HttpClientBuilder(HttpClient httpClient) + { + HTTP_CLIENT = httpClient; + } + + public IRESTClient build(string host) + { + if (HTTP_CLIENT.BaseAddress == null) + { + HTTP_CLIENT.BaseAddress = new Uri(host); + } + return new DefaultRESTClient(HTTP_CLIENT); + } } diff --git a/src/main/client/netcore.client.sync.ftl b/src/main/client/netcore.client.sync.ftl index 06c95e6f..51869cf2 100644 --- a/src/main/client/netcore.client.sync.ftl +++ b/src/main/client/netcore.client.sync.ftl @@ -50,8 +50,8 @@ namespace io.fusionauth { public class FusionAuthSyncClient : IFusionAuthSyncClient { public readonly FusionAuthClient client; - public FusionAuthSyncClient(string apiKey, string host, string tenantId = null) { - client = new FusionAuthClient(apiKey, host, tenantId); + public FusionAuthSyncClient(string apiKey, string host, string tenantId = null, IRESTClientBuilder clientBuilder = null) { + client = new FusionAuthClient(apiKey, host, tenantId, clientBuilder); } /**