mirror of
https://github.com/JKorf/CryptoExchange.Net.git
synced 2026-10-09 12:41:43 +00:00
resync
This commit is contained in:
@@ -21,16 +21,12 @@ namespace CryptoExchange.Net.Requests
|
||||
/// Create request object for web request
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="client"></param>
|
||||
/// <param name="isTracingEnabled">if true, should assign unique id for request</param>
|
||||
public Request(HttpRequestMessage request, HttpClient client, bool isTracingEnabled=false)
|
||||
/// <param name="client"></param>
|
||||
public Request(HttpRequestMessage request, HttpClient client)
|
||||
{
|
||||
httpClient = client;
|
||||
this.request = request;
|
||||
if (isTracingEnabled)
|
||||
{
|
||||
RequestId = Path.GetRandomFileName();
|
||||
}
|
||||
RequestId = Path.GetRandomFileName();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -52,7 +48,7 @@ namespace CryptoExchange.Net.Requests
|
||||
/// <inheritdoc />
|
||||
public Uri Uri => request.RequestUri;
|
||||
/// <inheritdoc />
|
||||
public string? RequestId { get; }
|
||||
public string RequestId { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public void SetContent(string data, string contentType)
|
||||
|
||||
@@ -14,9 +14,8 @@ namespace CryptoExchange.Net.Requests
|
||||
private HttpClient? httpClient;
|
||||
private bool isTracingEnabled;
|
||||
/// <inheritdoc />
|
||||
public void Configure(TimeSpan requestTimeout, ApiProxy? proxy, bool isTracingEnabled = false)
|
||||
{
|
||||
this.isTracingEnabled = isTracingEnabled;
|
||||
public void Configure(TimeSpan requestTimeout, ApiProxy? proxy)
|
||||
{
|
||||
HttpMessageHandler handler = new HttpClientHandler()
|
||||
{
|
||||
Proxy = proxy == null ? null : new WebProxy
|
||||
@@ -35,7 +34,7 @@ namespace CryptoExchange.Net.Requests
|
||||
if (httpClient == null)
|
||||
throw new InvalidOperationException("Cant create request before configuring http client");
|
||||
|
||||
return new Request(new HttpRequestMessage(method, uri), httpClient, isTracingEnabled);
|
||||
return new Request(new HttpRequestMessage(method, uri), httpClient);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user