IEnumerator GetTaskMetadata()

in UnityProject/Assets/Scripts/Server/Server.cs [181:202]


    IEnumerator GetTaskMetadata(string uri)
    {
        using (UnityWebRequest webRequest = UnityWebRequest.Get(uri))
        {
            // Request and wait for the desired page.
            yield return webRequest.SendWebRequest();

            if (webRequest.isNetworkError)
            {
                Debug.Log("Web request Error: " + webRequest.error);
            }
            else
            {
                Debug.Log("Web Request Received: " + webRequest.downloadHandler.text);
                var taskData = JsonUtility.FromJson<TaskData>(webRequest.downloadHandler.text);
                this.taskDataArn = taskData.TaskARN;
                this.taskDataArnWithContainer = taskData.TaskARN + "-" + Environment.GetEnvironmentVariable("CONTAINERNAME"); //Including the container name as we run multiple containers in a Task
                Debug.Log("TaskARN: " + this.taskDataArn);
                Debug.Log("TaskARN with container: " + this.taskDataArnWithContainer);
            }
        }
    }