Our app is a Unity-webGL app on a web server. This app uses UnityWebRequest to download content from Cloud Content Delivery.
Recently, I’ve been getting UnityWebRequest CORS errors even though I haven’t changed my app.
Could you tell us what kind of settings should be made on the Cloud Content Delivery side?
Networking, UnityWebRequest, WWW, Postman, curl, WebAPI, etc:
As with all network code, get it working with Postman or curl first. That makes it NOT a Unity problem. Solve the networking first. You must solve that or anything else is irrelevant.
Once you have that working, then try and port it to UnityWebRequest. If it still doesn't work, one handy debug solution is to hook up a proxy like Charles and compare the functioning output from Postman / curl to the output from Unity, and from that reason about where your issues are.
Always get network stuff working outside of Unity in either curl or PostMan, then connect a proxy such as Charles and start trying to replicate the traffic shape with UnityWebRequest.
Any other way risks wasting a lot of your time for trivial issues that only the above way will instantly reveal.
And setting up a proxy can be very helpful too, in order to compare traffic:
Thank you for replying. I observed traffic using a proxy.
If we make the UnityWebRequest on Unity Editor, 200 is returned.
But, when we make a UnityWebRequest on web local server, it returns 204.
And we do not get response information we want.