Skip to content

Commit

Permalink
Fix: Proton GET request (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
al-kau committed Jun 10, 2024
1 parent fc3010c commit e0ba259
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Sources/Tuvi.Proton.Impl/ProtonClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ public Request AddQueryParam(string key, string value)

public Task<TResponse> GetAsync<TResponse>(string uri) where TResponse : new()
{
return ExecuteAsync<TResponse, RestClient.EmptyRequest>(uri, HttpMethod.Get);
return ExecuteAsync<TResponse>(uri, HttpMethod.Get);
}

public Task PutAsync<TRequest>(string uri)
Expand Down Expand Up @@ -616,6 +616,15 @@ public Task<Stream> GetAsync(string uri)
headers: new RestClient.HeaderCollection(_headers));
}

private Task<TResponse> ExecuteAsync<TResponse>(string uriStr, HttpMethod method) where TResponse : new()
{
var uri = new Uri(uriStr + (_queryParams.Count > 0 ? ("?" + _queryParams.ToString()) : ""), UriKind.Relative);
return _session.RequestAsync<TResponse>(
endpoint: uri,
method: method,
headers: new RestClient.HeaderCollection(_headers));
}

private async Task<TResponse> ExecuteAsync2<TResponse>(string uriStr, HttpMethod method)
{
var res = await SendProtonAsync(uriStr, method).ConfigureAwait(false);
Expand Down

0 comments on commit e0ba259

Please sign in to comment.