seraphx2 / ESI.NET

A C# wrapper for the Eve Online ESI API.
https://www.nuget.org/packages/ESI.NET/
MIT License
40 stars 23 forks source link

Error: One or more errors occurred. (Operation is not supported on this platform.) when used on Blazor WebAssembly client. #77

Open AdmirableTable opened 6 days ago

AdmirableTable commented 6 days ago

When using the package in a Blazor WebAssembly client, it immediately triggers the following error:

Error: One or more errors occurred. (Operation is not supported on this platform.)

Only tested on Google Chrome so far.

AdmirableTable commented 6 days ago

While investigating further, I was able to identify the issue to be here: https://github.com/seraphx2/ESI.NET/blob/master/ESI.NET/EsiClient.cs#L30

Any value given for AutomaticDecompression sustains the error, and removing it entirely effectively removes the error, but then decompression would have to be implemented manually.

Proposed solution replace HttpClient with RestSharp, the most widely used Rest client, which is much more convenient than implementing those features manually and would handle the decompression issue easily. I am currently working on it myself and will submit a pull request to save some time unless you prefer fixing this otherwise.