Skip to content

Conversation

eriawan
Copy link
Member

@eriawan eriawan commented Oct 14, 2025

Fixes #104716 by marking HttpClient.Send with UnsupportedOSPlatform with values of android, ios over eixisting.

Please review.

cc @wfurt , @ManickaP

@Copilot Copilot AI review requested due to automatic review settings October 14, 2025 18:39
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Oct 14, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses issue #104716 by adding platform-specific annotations to mark HttpClient.Send methods as unsupported on Android and iOS platforms, in addition to the existing browser platform restriction.

Key changes:

  • Added UnsupportedOSPlatform attributes for "android" and "ios" to synchronous Send methods
  • Uncommented previously commented-out platform attributes in HttpClientHandler
  • Updated both implementation and reference assembly files for consistency

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
HttpMessageInvoker.cs Added android and ios platform restrictions to the base Send method
HttpClientHandler.AnyMobile.cs Uncommented android and ios platform attributes for the Send method override
HttpClient.cs Added android and ios platform restrictions to all four Send method overloads
System.Net.Http.cs Updated reference assembly to reflect the new platform restrictions
Comments suppressed due to low confidence (1)

src/libraries/System.Net.Http/ref/System.Net.Http.cs:1

  • Corrected malformed attribute name from 'UnsupportedOSPlatformAttributeUnsupportedOSPlatform' to 'UnsupportedOSPlatform'.
// Licensed to the .NET Foundation under one or more agreements.

Copy link
Contributor

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

accept copilot suggestion to correct UnsupportedOSPlatform attribute name

Co-authored-by: Copilot <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-System.Net.Http community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HttpClient.Send not supported in MAUI running on Android or iOS causing PlatformNotSupportedException

1 participant