Skip to content

Commit

Permalink
Support project param in api client (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
daveleek committed Apr 28, 2021
1 parent 2809b36 commit fd3e016
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Unleash/Communication/UnleashApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,25 @@ internal class UnleashApiClient : IUnleashApiClient
private readonly HttpClient httpClient;
private readonly IJsonSerializer jsonSerializer;
private readonly UnleashApiClientRequestHeaders clientRequestHeaders;
private readonly string project;

public UnleashApiClient(
HttpClient httpClient,
IJsonSerializer jsonSerializer,
UnleashApiClientRequestHeaders clientRequestHeaders)
UnleashApiClientRequestHeaders clientRequestHeaders,
string project = null)
{
this.httpClient = httpClient;
this.jsonSerializer = jsonSerializer;
this.clientRequestHeaders = clientRequestHeaders;
this.project = project;
}

public async Task<FetchTogglesResult> FetchToggles(string etag, CancellationToken cancellationToken)
{
const string resourceUri = "client/features";
string resourceUri = "client/features";
if (!string.IsNullOrWhiteSpace(this.project))
resourceUri += "?project=" + this.project;

using (var request = new HttpRequestMessage(HttpMethod.Get, resourceUri))
{
Expand Down

0 comments on commit fd3e016

Please sign in to comment.