feat(BaseHttpClientService): Header hinzugefügt

This commit is contained in:
Developer 02 2024-11-22 09:15:04 +01:00
parent 70ccec9fef
commit 85e5fc4018
2 changed files with 5 additions and 0 deletions

View File

@ -13,6 +13,7 @@ namespace DigitalData.Core.Abstractions.Client
HttpMethod? method = null,
HttpContent? body = null,
Dictionary<string, string>? form = null,
Dictionary<string, string>? headers = null,
bool sendWithCookie = true,
bool saveCookie = true
);

View File

@ -27,6 +27,7 @@ namespace DigitalData.Core.Client
HttpMethod? method = null,
HttpContent? body = null,
Dictionary<string, string>? form = null,
Dictionary<string, string>? headers = null,
bool sendWithCookie = true,
bool saveCookie = true
)
@ -40,6 +41,9 @@ namespace DigitalData.Core.Client
var requestMessage = new HttpRequestMessage(method, requestUriStr);
// Add headers if provided
headers?.ForEach(header => requestMessage.Headers.Add(header.Key, header.Value));
// Add cookie to request
if (sendWithCookie)
{