'.Net Maui Blazor - Does HttpClient or WebRequest work at all?

Using VS 17.3 Preview 1, .Net Maui Blazor, I can't get httpclient or webrequest to work at all in Android. I've tried all the android option project settings (blank, managed, Android, legacy), also tls blank and 1.2 . I've tried various workarounds:

  1. Xamarin.Android.Net.AndroidMessageHandler clientHandler //for message handler

  2. ServicePointManager.CheckCertificateRevocationList = false; ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };

I've tried all these different combinations form the Android emulator and also on an android device.

The closet I've come is with webrequest: status: UnknownError message: The SSL connection could not be established, see inner exception.

Has anyone managed to make an https call? Any ideas or suggestions?
Thanks in advance, Rich


WebRequest request = WebRequest.Create("https://fonts.googleapis.com"); // any https site
request.Method = "POST";                                      
string postData = win;  
byte[] byteArray = Encoding.UTF8.GetBytes(postData);
request.ContentType = "application/x-www-form-urlencoded";
request.ContentLength = byteArray.Length;
Stream dataStream = request.GetRequestStream();
dataStream.Write(byteArray, 0, byteArray.Length);
dataStream.Close();


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source