Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question UnityWebRequest ConnectionError in 2021 LTS but not 2020 LTS, WebGL

Discussion in 'Scripting' started by aer0ace, Nov 9, 2022.

  1. aer0ace

    aer0ace

    Joined:
    May 11, 2012
    Posts:
    1,511
    I'm running into a weird issue, where I call UnityWebRequest, and it succeeds in 2020 LTS, but not in 2021 LTS. This is on a WebGL build. In the Unity Editor, it works fine. I'm calling the exact same url under both versions. In 2021 LTS, I get result ConnectionError.

    The server is a .NET 6.0 console application.

    Anyone have any ideas where I can look into this more? Or is there a known issue with 2021 LTS WebGL builds?
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    37,243
    Always the device / runtime / browser logs, obviously.

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

    https://forum.unity.com/threads/using-unity-for-subscription-lists.1070663/#post-6910289

    https://forum.unity.com/threads/unity-web-request-acting-stupid.1096396/#post-7060150

    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
     
  3. aer0ace

    aer0ace

    Joined:
    May 11, 2012
    Posts:
    1,511
    Ah, I can always count on Kurt-Dekker's copy and paste response to be at the ready. If it weren't so helpful, I would otherwise find it annoying.
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    37,243
    Thanks, I try. I am always amending my copy/pasta stuff, plus often it gets hand-modified as I post it for a particular answer.

    I am always open to suggestions for how to make it more useful, so don't be shy if you have ideas!
     
  5. aer0ace

    aer0ace

    Joined:
    May 11, 2012
    Posts:
    1,511