1
0
mirror of https://github.com/JKorf/CryptoExchange.Net.git synced 2026-10-08 04:11:10 +00:00

Added ForcePathEndWithSlash setting to RequestDefinition, added encoding parameter to SetContent on REST Request, added RequestBodyContentEncoding and OmitContentTypeHeaderWithoutContent config to RestApiClient

This commit is contained in:
Jkorf
2026-03-06 09:25:04 +01:00
parent 33c0fb26a7
commit eaf092a334
7 changed files with 42 additions and 20 deletions
+4 -5
View File
@@ -19,9 +19,6 @@ namespace CryptoExchange.Net.Requests
/// <summary>
/// Create request object for web request
/// </summary>
/// <param name="request"></param>
/// <param name="client"></param>
/// <param name="requestId"></param>
public Request(HttpRequestMessage request, HttpClient client, int requestId)
{
_httpClient = client;
@@ -55,10 +52,12 @@ namespace CryptoExchange.Net.Requests
public int RequestId { get; }
/// <inheritdoc />
public void SetContent(string data, string contentType)
public void SetContent(string data, Encoding? encoding, string contentType)
{
Content = data;
_request.Content = new StringContent(data, Encoding.UTF8, contentType);
_request.Content = new StringContent(data, encoding ?? Encoding.UTF8, contentType);
if (encoding == null)
_request.Content.Headers.ContentType!.CharSet = null;
}
/// <inheritdoc />