Skip to content

Commit

Permalink
run preparation methods on all HttpClient.Send() overloads
Browse files Browse the repository at this point in the history
fix issue where calling httpClient.Send(HttpRequestMessage) will not
apply the given DefaultRequestHeaders, BaseAddress and TLS settings
  • Loading branch information
patagonaa committed Apr 2, 2024
1 parent e65c21f commit 94646f6
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion nanoFramework.System.Net.Http/Http/HttpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
/// </remarks>
public partial class HttpClient : HttpMessageInvoker
{
Expand Down Expand Up @@ -352,6 +352,19 @@ public string GetString(string requestUri)

#region Advanced Send Overloads

/// <summary>
/// Sends an HTTP request with the specified request.
/// </summary>
/// <param name="request">The HTTP request message to send.</param>
/// <returns>The HTTP response message.</returns>
/// <exception cref="ArgumentNullException">The request is <see langword="null"/>.</exception>
/// <exception cref="InvalidOperationException">The request message was already sent by the <see cref="HttpClient"/> instance.</exception>
/// <exception cref="HttpRequestException">The request failed due to an underlying issue such as network connectivity, DNS failure, or server certificate validation.</exception>
public override HttpResponseMessage Send(HttpRequestMessage request)
{
return Send(request, DefaultCompletionOption);
}

/// <summary>
/// Sends an HTTP request with the specified request.
/// </summary>
Expand Down

0 comments on commit 94646f6

Please sign in to comment.