Skip to content

Commit 3414272

Browse files
CopilotPureWeen
andcommitted
Extract HttpClient utilities from PR 30293 and add to public API
Co-authored-by: PureWeen <[email protected]>
1 parent fc57385 commit 3414272

File tree

10 files changed

+19
-2
lines changed

10 files changed

+19
-2
lines changed

src/Controls/tests/TestCases.HostApp/TestCases.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System.Reflection;
2+
using Microsoft.Maui.Platform;
23

34
namespace Maui.Controls.Sample
45
{
@@ -18,7 +19,7 @@ void CheckInternetAndLoadPage(Type type)
1819
{
1920
try
2021
{
21-
using (var httpClient = new HttpClient())
22+
using (var httpClient = HttpClientUtilities.CreateHttpClient())
2223
{
2324
httpClient.Timeout = TimeSpan.FromSeconds(5);
2425
using (var httpResponse = httpClient.GetAsync(@"https://www.github.com", HttpCompletionOption.ResponseHeadersRead))

src/Core/src/Platform/HttpClientUtilities.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace Microsoft.Maui.Platform
88
/// Utilities for creating HttpClient instances with proper SSL certificate handling.
99
/// Based on fix from dotnet/android for certificate revocation check failures.
1010
/// </summary>
11-
internal static class HttpClientUtilities
11+
public static class HttpClientUtilities
1212
{
1313
/// <summary>
1414
/// Creates an HttpClient with proper SSL certificate revocation handling to avoid

src/Core/src/PublicAPI/net-android/PublicAPI.Shipped.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3363,3 +3363,5 @@ virtual Microsoft.Maui.WindowOverlay.HandleUIChange() -> void
33633363
virtual Microsoft.Maui.WindowOverlay.Initialize() -> bool
33643364
virtual Microsoft.Maui.WindowOverlay.RemoveWindowElement(Microsoft.Maui.IWindowOverlayElement! drawable) -> bool
33653365
virtual Microsoft.Maui.WindowOverlay.RemoveWindowElements() -> void
3366+
Microsoft.Maui.Platform.HttpClientUtilities
3367+
static Microsoft.Maui.Platform.HttpClientUtilities.CreateHttpClient() -> System.Net.Http.HttpClient!

src/Core/src/PublicAPI/net-ios/PublicAPI.Shipped.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3293,3 +3293,5 @@ virtual Microsoft.Maui.WindowOverlay.HandleUIChange() -> void
32933293
virtual Microsoft.Maui.WindowOverlay.Initialize() -> bool
32943294
virtual Microsoft.Maui.WindowOverlay.RemoveWindowElement(Microsoft.Maui.IWindowOverlayElement! drawable) -> bool
32953295
virtual Microsoft.Maui.WindowOverlay.RemoveWindowElements() -> void
3296+
Microsoft.Maui.Platform.HttpClientUtilities
3297+
static Microsoft.Maui.Platform.HttpClientUtilities.CreateHttpClient() -> System.Net.Http.HttpClient!

src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Shipped.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3293,3 +3293,5 @@ virtual Microsoft.Maui.WindowOverlay.HandleUIChange() -> void
32933293
virtual Microsoft.Maui.WindowOverlay.Initialize() -> bool
32943294
virtual Microsoft.Maui.WindowOverlay.RemoveWindowElement(Microsoft.Maui.IWindowOverlayElement! drawable) -> bool
32953295
virtual Microsoft.Maui.WindowOverlay.RemoveWindowElements() -> void
3296+
Microsoft.Maui.Platform.HttpClientUtilities
3297+
static Microsoft.Maui.Platform.HttpClientUtilities.CreateHttpClient() -> System.Net.Http.HttpClient!

src/Core/src/PublicAPI/net-tizen/PublicAPI.Shipped.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3055,3 +3055,5 @@ virtual Microsoft.Maui.WindowOverlay.HandleUIChange() -> void
30553055
virtual Microsoft.Maui.WindowOverlay.Initialize() -> bool
30563056
virtual Microsoft.Maui.WindowOverlay.RemoveWindowElement(Microsoft.Maui.IWindowOverlayElement! drawable) -> bool
30573057
virtual Microsoft.Maui.WindowOverlay.RemoveWindowElements() -> void
3058+
Microsoft.Maui.Platform.HttpClientUtilities
3059+
static Microsoft.Maui.Platform.HttpClientUtilities.CreateHttpClient() -> System.Net.Http.HttpClient!

src/Core/src/PublicAPI/net-windows/PublicAPI.Shipped.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3170,3 +3170,5 @@ virtual Microsoft.Maui.WindowOverlay.HandleUIChange() -> void
31703170
virtual Microsoft.Maui.WindowOverlay.Initialize() -> bool
31713171
virtual Microsoft.Maui.WindowOverlay.RemoveWindowElement(Microsoft.Maui.IWindowOverlayElement! drawable) -> bool
31723172
virtual Microsoft.Maui.WindowOverlay.RemoveWindowElements() -> void
3173+
Microsoft.Maui.Platform.HttpClientUtilities
3174+
static Microsoft.Maui.Platform.HttpClientUtilities.CreateHttpClient() -> System.Net.Http.HttpClient!

src/Core/src/PublicAPI/net/PublicAPI.Shipped.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2566,3 +2566,5 @@ virtual Microsoft.Maui.WindowOverlay.HandleUIChange() -> void
25662566
virtual Microsoft.Maui.WindowOverlay.Initialize() -> bool
25672567
virtual Microsoft.Maui.WindowOverlay.RemoveWindowElement(Microsoft.Maui.IWindowOverlayElement! drawable) -> bool
25682568
virtual Microsoft.Maui.WindowOverlay.RemoveWindowElements() -> void
2569+
Microsoft.Maui.Platform.HttpClientUtilities
2570+
static Microsoft.Maui.Platform.HttpClientUtilities.CreateHttpClient() -> System.Net.Http.HttpClient!

src/Core/src/PublicAPI/netstandard/PublicAPI.Shipped.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2566,3 +2566,5 @@ virtual Microsoft.Maui.WindowOverlay.HandleUIChange() -> void
25662566
virtual Microsoft.Maui.WindowOverlay.Initialize() -> bool
25672567
virtual Microsoft.Maui.WindowOverlay.RemoveWindowElement(Microsoft.Maui.IWindowOverlayElement! drawable) -> bool
25682568
virtual Microsoft.Maui.WindowOverlay.RemoveWindowElements() -> void
2569+
Microsoft.Maui.Platform.HttpClientUtilities
2570+
static Microsoft.Maui.Platform.HttpClientUtilities.CreateHttpClient() -> System.Net.Http.HttpClient!

src/Core/src/PublicAPI/netstandard2.0/PublicAPI.Shipped.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2564,3 +2564,5 @@ virtual Microsoft.Maui.WindowOverlay.HandleUIChange() -> void
25642564
virtual Microsoft.Maui.WindowOverlay.Initialize() -> bool
25652565
virtual Microsoft.Maui.WindowOverlay.RemoveWindowElement(Microsoft.Maui.IWindowOverlayElement! drawable) -> bool
25662566
virtual Microsoft.Maui.WindowOverlay.RemoveWindowElements() -> void
2567+
Microsoft.Maui.Platform.HttpClientUtilities
2568+
static Microsoft.Maui.Platform.HttpClientUtilities.CreateHttpClient() -> System.Net.Http.HttpClient!

0 commit comments

Comments
 (0)