1
0
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:
JKorf
2020-08-24 12:01:49 +02:00
parent c8a6a2ec12
commit 664cbee8dd
8 changed files with 93 additions and 211 deletions
+4 -3
View File
@@ -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);
}
}
}