I am getting data from server using UnityWebRequest
. At the first time it receives, when I update my data in server, the unity data is not updated and it shows me old data. I have to clear the cache and again get the data from server.
Here is the code.
public Text mytext;
void Start()
{
StartCoroutine(GetText());
}
IEnumerator GetText()
{
UnityWebRequest www = UnityWebRequest.Get("https://www.simplearcadegamers.com/wp-content/uploads/2019/GetData.php");
yield return www.SendWebRequest();
if(www.isNetworkError || www.isHttpError)
{
Debug.Log(www.error);
}
else
{
// Show results as text
Debug.Log(www.downloadHandler.text);
// Or retrieve results as binary data
byte[] results = www.downloadHandler.data;
}
}