Hello,
please, is here somebody, who has expirience with WebGL and UnityWebRequest. I need get file from url. This file is in XML format and need use it in my project, for deserialization.
IEnumerator GetFile()
{
using (UnityWebRequest request = UnityWebRequest.Get("http://test.cc/Test/_TestSnapshot.xml"))
{
yield return request.SendWebRequest();
if (request.isNetworkError) // Error
{
Debug.Log(request.error);
}
else // Success
{
snapshot = request.downloadHandler.text;
}
}
}
// Start is called before the first frame update
private void Start()
{
StartCoroutine(GetText());
}
But when I get this file: Compiled program, give in last chrome this error message:
Data at the root level is invalid. Line 1, position 1, when writing.
Thanks.
HD