Operation is not supported on this platform. when using HttpClient.send on ios and android
See original GitHub issueDescription
Why I try to call a service from ios or android I get a System.PlatformNotSupportedException. The code works perfectly in windows. even if I try to hit something like http://goole.ca I get the same error.
Steps to Reproduce
A added the following code to your default sample and get the error:
public partial class App : Application
{
public App()
{
InitializeComponent();
MainPage = new AppShell();
try
{
HttpClient client = new HttpClient();
HttpResponseMessage response = client.Send(new HttpRequestMessage(HttpMethod.Get, "http://goole.ca"));
System.Diagnostics.Debug.WriteLine(response.StatusCode.ToString());
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine(ex.Message);
}
}
}
I am using VS 17.4 Preview 2.1 (6.0.540) does not appear in the list below.
Link to public reproduction project repository
none
Version with bug
Unknown/Other (please specify)
Last version that worked well
Unknown/Other
Affected platforms
iOS, Android
Affected platform versions
iOS 15.5, android api33
Did you find any workaround?
No response
Relevant log output
No response
Issue Analytics
- State:
- Created a year ago
- Comments:12 (4 by maintainers)
Top Results From Across the Web
C# - Xamarin - HttpClient - Operation is not valid due to the ...
I'm working on a cross platform library that makes HTTP requests. It's working fine on Android, but when I try to use it...
Read more >HttpClient operations not working - Microsoft Q&A
So I have a service that is up and working, I can access it from the physical device on its browser, and make...
Read more >Operation is not supported on this platform - Microsoft Q&A
the "Operation is not supported on this platform" error means the function was ported to .net core, but requires O/S support and was...
Read more >Windows Authentication with HttpClient - Rick Strahl's Web Log
In this short post I review how to use HttpClient with Windows Authentication security using Negotiate or NTLM authentication schemes, ...
Read more >Troubleshoot Smart Licensing on Catalyst Platforms
This document describes how to work with Cisco Smart Licensing (cloud-based system) to manage software licenses on Catalyst switches.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

VS Preview 3 fixed the problem
As mentioned earlier, this is simply not supported. If you want to learn more details about the why and how you’ll have to contact the runtime team. This is not something that originates in .NET MAUI.