UnityWebRequest error Cannot connect to destination host

Hello guys,

Im trying to do a get Request to a server using Unity web request but im getting a “Cannot connect to destination host” error.

The URL is working in a browser but it simply fails everytime from unity. The URL that im trying to get is classified by the browser as not secure so Im not sure if this could cause this error.

IEnumerator descargarListaServidores(){

        UnityWebRequest www = UnityWebRequest.Get("xxx.xxx.xxx.xxx:14100/infoServidor");
        yield return www.SendWebRequest();
       
        if (www.result != UnityWebRequest.Result.Success) {
            Debug.Log(www.error);
        }else {
            textoListaDeServidores = www.downloadHandler.text;
            Debug.Log(textoListaDeServidores);
        }
        yield return null;
    }

9121651--1265800--upload_2023-7-3_10-10-31.png

9121651--1265797--upload_2023-7-3_10-6-39.png

Networking, UnityWebRequest, WWW, Postman, curl, WebAPI, etc:

And setting up a proxy can be very helpful too, in order to compare traffic:

If thos ‘x’ characters are the IP address, then your URL is missing the http:// prefix.

1 Like