mirror of
https://github.com/JKorf/CryptoExchange.Net.git
synced 2026-10-06 19:31:17 +00:00
Changed requestId to int, added it to more logging related to requests. Added some comments
This commit is contained in:
@@ -22,11 +22,12 @@ namespace CryptoExchange.Net.Requests
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <param name="client"></param>
|
||||
public Request(HttpRequestMessage request, HttpClient client)
|
||||
/// <param name="requestId"></param>
|
||||
public Request(HttpRequestMessage request, HttpClient client, int requestId)
|
||||
{
|
||||
httpClient = client;
|
||||
this.request = request;
|
||||
RequestId = Path.GetRandomFileName();
|
||||
RequestId = requestId;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
@@ -48,7 +49,7 @@ namespace CryptoExchange.Net.Requests
|
||||
/// <inheritdoc />
|
||||
public Uri Uri => request.RequestUri;
|
||||
/// <inheritdoc />
|
||||
public string RequestId { get; }
|
||||
public int RequestId { get; }
|
||||
|
||||
/// <inheritdoc />
|
||||
public void SetContent(string data, string contentType)
|
||||
|
||||
@@ -36,12 +36,12 @@ namespace CryptoExchange.Net.Requests
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public IRequest Create(HttpMethod method, string uri)
|
||||
public IRequest Create(HttpMethod method, string uri, int requestId)
|
||||
{
|
||||
if (httpClient == null)
|
||||
throw new InvalidOperationException("Cant create request before configuring http client");
|
||||
|
||||
return new Request(new HttpRequestMessage(method, uri), httpClient);
|
||||
return new Request(new HttpRequestMessage(method, uri), httpClient, requestId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user