Search Unity

UnityWebRequest return Unknow Error code 0

Discussion in 'Scripting' started by guzz, Dec 21, 2019.

  1. guzz

    guzz

    Joined:
    Dec 16, 2012
    Posts:
    5
    I write a very simple script to read the string from my website:
    Code (CSharp):
    1.  
    2.     void Start()
    3.     {
    4.         StartCoroutine(SendRequest());
    5.     }
    6.  
    7.     IEnumerator SendRequest()
    8.     {
    9.         UnityWebRequest uwr = UnityWebRequest.Get("https://www.gzztech.cn/");
    10.         yield return uwr.SendWebRequest();
    11.         if (uwr.isHttpError || uwr.isNetworkError)
    12.         {
    13.             Debug.Log(uwr.error + " " + uwr.responseCode);
    14.         }
    15.         else
    16.         {
    17.             Debug.Log("Get:Success");
    18.             string a = uwr.downloadHandler.text;
    19.             Debug.Log(a);
    20.         }
    21.     }
    22.  
    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
     
    Last edited: Dec 21, 2019
  2. JqHuang

    JqHuang

    Joined:
    Aug 29, 2019
    Posts:
    1
    Hello, I have the same problem. Have you solved your problem?
     
    OgoneTech likes this.
  3. JD_FVTC

    JD_FVTC

    Joined:
    Oct 20, 2017
    Posts:
    54
    Anyone Get this figured out? Permission issue?
     
  4. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,735
    If I try to open that link in Firefox, it does not open it telling me the website is insecure, details are that certificate expired on 2021-09-27.
    Granted, the error from UWR is not descriptiive, but since the original post is quite old, I believe that has been fixed.