1. Home
  2. Docs
  3. UniREST Solution 3.5
  4. Support
  5. WebGL

WebGL

The WebGL platform is a little bit tricky to manage because it doesn’t fully support some .NET features and it’s under some server-side rules you have to consider and which may raise some issues.

Starting from the 3.0 version, the UniREST Solution now supports the WebGL platform. In general, while with the other platform there aren’t relevant things you have to consider, the WebGL platform requires that things are done respecting some rule.

UniRESTClient

In the UniRESTClient class, you have to use the methods under the UniRESTClient.Async class. This a new generation of methods that work asynchronously and are supported by WebGL.

UniREST Server application

One of the most important things to resolve, when you work with the WebGL platform, is to respect the CORS policies (have a look here for more details). When you encounter this kind of issue, you receive (in the browser console) a message like this:

Access to XMLHttpRequest at ‘http…’ from origin ‘http…’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: The ‘Access-Control-Allow-Origin’ header has a value ‘http….’ that is not equal to the supplied origin.

This issue is raised by the REST communications when a call to an API is not authorized by your server rules.

To resolve this problem, you must configure the Access Control Allow Origin setting in the UniREST Settings panel:

For more details, have a look at the UniREST Settings chapter. Also, for technical details have a look at this page: WebGL URL use