UnityWebRequestTexture works with manually entered URL, fails when URL retrieved from Google Sheet

Hi all,

So I’m retrieving info from a Google Sheet, including URLs to images. I have no problem receiving the info, and when I look at the list of URLs in the inspector they seem to be valid, but when I UnityWebRequest.GetTexture(url) from my URL List I get “Cannot connect to destination host”, whereas when I UnityWebRequest.GetTexture(“https://via.placeholder.com/600/92c952”) it loads just fine.

Is there some sort of reformatting needed? Or what could be the case? Thanks!

For reference:

IEnumerator GetTextureRequest(string url, GameObject item)
    {
        //url = UnityWebRequest.EscapeURL(url); //tried this, no luck
        using (UnityWebRequest www = UnityWebRequestTexture.GetTexture(url)) //this way returns the error
        //using (UnityWebRequest www = UnityWebRequestTexture.GetTexture("one of the image urls I'm using.jpg")) //this way works, but is obviously unusable
        {
            yield return www.SendWebRequest();

            if (www.isNetworkError || www.isHttpError)
            {
                Debug.Log(www.error);
            }
            else
            {
                if (www.isDone)
                {
                    var texture = DownloadHandlerTexture.GetContent(www);
                    var rect = new Rect(0, 0, 60f, 60f);
                    var sprite = Sprite.Create(texture, rect, new Vector2(0.0f, 0.0f));
                    var images = item.GetComponentsInChildren<Image>();
                    images[1].sprite = sprite;
                }
            }
        }
    }

Could really be just about anything, but here’s how to investigate:

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

https://discussions.unity.com/t/831681/2

https://discussions.unity.com/t/837672/2

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

https://support.unity.com/hc/en-us/articles/115002917683-Using-Charles-Proxy-with-Unity

Thanks! I found the issue; I had it reading the wrong URLs.