From my Android app I execute a http PUT request with JSON:
UnityWebRequest www = UnityWebRequest.Put(fullUrl,json);
www.SetRequestHeader("Content-Type", "application/json");
yield return www.SendWebRequest();
This code works fine when building with Unity 2018.4.1f1. But if I build with Unity 2019.1.6f1 I get:
www.error : "Unknown"
www.responseCode: 0
www.isNetworkError: true
www.isHttpError: false
www.downloadHandler.text : ""
When I run this code directly in unity, it works fine, and I have no problems communicating with the server. Only building to Android in Unity 2019.1 doesn't work. I also tried the new 2019.3.0a5, and there the Anroid version also works. This is quite a mystery.
Anyone have any idea what's going on?
↧