Skip to content

Commit be8176e

Browse files
authored
Run preparation methods on all HttpClient.Send() overloads (#414)
1 parent e65c21f commit be8176e

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

nanoFramework.System.Net.Http/Http/HttpClient.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ namespace System.Net.Http
2020
/// In addition, every HttpClient instance uses its own connection pool,
2121
/// isolating its requests from requests executed by other HttpClient instances.
2222
///
23-
/// HttpClient is intended to be instantiated once and reused throughout the life of an application.
23+
/// HttpClient is intended to be instantiated once and reused throughout the life of an application.
2424
/// </remarks>
2525
public partial class HttpClient : HttpMessageInvoker
2626
{
@@ -352,6 +352,19 @@ public string GetString(string requestUri)
352352

353353
#region Advanced Send Overloads
354354

355+
/// <summary>
356+
/// Sends an HTTP request with the specified request.
357+
/// </summary>
358+
/// <param name="request">The HTTP request message to send.</param>
359+
/// <returns>The HTTP response message.</returns>
360+
/// <exception cref="ArgumentNullException">The request is <see langword="null"/>.</exception>
361+
/// <exception cref="InvalidOperationException">The request message was already sent by the <see cref="HttpClient"/> instance.</exception>
362+
/// <exception cref="HttpRequestException">The request failed due to an underlying issue such as network connectivity, DNS failure, or server certificate validation.</exception>
363+
public override HttpResponseMessage Send(HttpRequestMessage request)
364+
{
365+
return Send(request, DefaultCompletionOption);
366+
}
367+
355368
/// <summary>
356369
/// Sends an HTTP request with the specified request.
357370
/// </summary>

0 commit comments

Comments
 (0)