Curl 56 error: Recv failure Connection was reset

my project run in unity editor always appear “Curl 56 error: Recv failure Connection was reset” when I romete the sever use UnityWebRequest, but it no error run in apk and unity editor in version 2019.2.2f,
the version higher the 2019.4.x is appear this error in unity editor

Yes! Pretty, pretty please Unity, make this happen!

2 Answers

2

For my project, I debugged my function that contain UnityWebRequest in the script and the problem was cause by the website you requesting from OR your internet. This is a part of my code:

IEnumerator GetESTTime()
    {
        var request = UnityWebRequest.Get("http://worldtimeapi.org/api/timezone/EST");
        yield return request.SendWebRequest();

//part of the code for debugging ----
        if(request.isHttpError || request.isNetworkError) 
        {
            Debug.Log("Error");
            //setting my player date time to default when I don't get the date from the web
            playerDateTime = DateTime.Now;
            yield break;
        }
//part of the code for debugging ----

        else
        {
        // my other functions
        }

after upgrade to Unity 6000.3.0f1 cause same issue:

Curl error 56: Recv failure: Connection was reset

            var form = new WWWForm();
            form.AddBinaryData("file", imageBytes, $"{id}", "image/png");

            using var request = UnityWebRequest.Post($"{baseUrl}/upload/{typeId}/{id}", form);
            await request.SendWebRequest();

With previous versions like 2022.3.62f2 works without issue.