I’m trying to send a UnityWebRequest to a server.
It works perfectly on the WebGL Player, but not in the Editor
private static IEnumerator SendWebRequest(UnityWebRequest webRequest, UnityAction doneAction)
{
using (webRequest)
{
yield return webRequest.Send();
if (webRequest.isError)
{
throw new Exception("Could not connect to backend: " + webRequest.responseCode);
}
doneAction();
}
}
In Editor, I simply dont receive anything from the server. The responseCode is 0.
CORS has been set up accourdingly to the Unity Manual.
I can get a response to other servers, e.g. www.google.com, it’s just my server that is not working. Is there something else that needs to be configured in order for it to work?