From 94646f64fc1345cebe2a16e71ca214c0e4986895 Mon Sep 17 00:00:00 2001 From: patagona Date: Tue, 2 Apr 2024 17:33:31 +0200 Subject: [PATCH] run preparation methods on all HttpClient.Send() overloads fix issue where calling httpClient.Send(HttpRequestMessage) will not apply the given DefaultRequestHeaders, BaseAddress and TLS settings --- nanoFramework.System.Net.Http/Http/HttpClient.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/nanoFramework.System.Net.Http/Http/HttpClient.cs b/nanoFramework.System.Net.Http/Http/HttpClient.cs index 4dcb343..0726938 100644 --- a/nanoFramework.System.Net.Http/Http/HttpClient.cs +++ b/nanoFramework.System.Net.Http/Http/HttpClient.cs @@ -20,7 +20,7 @@ namespace System.Net.Http /// In addition, every HttpClient instance uses its own connection pool, /// isolating its requests from requests executed by other HttpClient instances. /// - /// HttpClient is intended to be instantiated once and reused throughout the life of an application. + /// HttpClient is intended to be instantiated once and reused throughout the life of an application. /// public partial class HttpClient : HttpMessageInvoker { @@ -352,6 +352,19 @@ public string GetString(string requestUri) #region Advanced Send Overloads + /// + /// Sends an HTTP request with the specified request. + /// + /// The HTTP request message to send. + /// The HTTP response message. + /// The request is . + /// The request message was already sent by the instance. + /// The request failed due to an underlying issue such as network connectivity, DNS failure, or server certificate validation. + public override HttpResponseMessage Send(HttpRequestMessage request) + { + return Send(request, DefaultCompletionOption); + } + /// /// Sends an HTTP request with the specified request. ///