I write a very simple script to read the string from my website:
void Start()
{
StartCoroutine(SendRequest());
}
IEnumerator SendRequest()
{
UnityWebRequest uwr = UnityWebRequest.Get("https://www.gzztech.cn/");
yield return uwr.SendWebRequest();
if (uwr.isHttpError || uwr.isNetworkError)
{
Debug.Log(uwr.error + " " + uwr.responseCode);
}
else
{
Debug.Log("Get:Success");
string a = uwr.downloadHandler.text;
Debug.Log(a);
}
}
return error : “Unknown Error 0”. the url just return a very simple string. I can open the page in any brower.
what’s the wrong?Thank you!
Unity version : 2018.3.13f1