-
Notifications
You must be signed in to change notification settings - Fork 742
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basic stuff: HttpClient not working in WebAssembly App #18912
Comments
It may likely be a CORS issue (https://en.wikipedia.org/wiki/Cross-origin_resource_sharing), |
Thank you! You're right. I've just came across a curiosity, if I instantiate a HttpClient in the following way (with a handler that accepts all certificates), it fails with an [Operation not supported on this platform] when doing client.Get() or client.Post(). It still works for Android and Desktop. Here is the code that exposes it:
Do you think its an intentional feature, or should I raise it as an issue? Regards |
This an intentional feature, yes, coming from the .NET runtime. The underlying fetch API cannot provide that feature, and it's been disabled in the BCL. |
We can close this |
Current behavior
I'm a newbie to Uno, thinking to migrate away from .net MAUI. But I quickly ran into this basic problem:
Using a VERY simple app, you click a button and then access www.google.com using HttpClient. It works when compiled for Android, it fails when compiled for WebAssembly.
The sample repository is here:
https://github.com/hbraasch/UnoHttpClientTester.git
The HttpClient code used is here:
This is the result when running Android:
This is the result when running WebAssembly:
Anu idea what can be wrong?
Help shall be much appreciated.
Expected behavior
The WebAssembly App must respond exactly the same as Android App
How to reproduce it (as minimally and precisely as possible)
Minimal repro project supplied:
https://github.com/hbraasch/UnoHttpClientTester.git
Workaround
Not known
Works on UWP/WinUI
Yes
Environment
No response
NuGet package version(s)
Nothing extra used
Affected platforms
WebAssembly
IDE
Visual Studio 2022
IDE version
N/A
Relevant plugins
N/A
Anything else we need to know?
Have no idea how to fix this
The text was updated successfully, but these errors were encountered: