- Home /
Question by
tiagorpg · Jul 12, 2018 at 03:30 PM ·
textwwwwebrequest
www.text only shows the first char
if i send the same url from my browser i receive "7=2" but when i call www.text in unit it ony shows 7, and that after i remove the first 3 char, because of something related to BOM
public static IEnumerator EventosMes(int ano,int mes,int[] eventos) {
string url = string.Format("http://localhost:8000/usuario/contarEventosMes/mes={0}&ano={1}",mes,ano);
Debug.Log(url);
WWW www = new WWW(url);
yield return www;
if (www.error==null) {
string results = www.text;
results = results.Substring(3, results.Length-3);
Debug.Log("test= " + results);
foreach (string s in results.Split('&'))
{
if (s != "") {
int l = int.Parse(s.Split('=')[0]);
int r = int.Parse(s.Split('=')[1]);
Debug.Log("evento[" + l + "]=" + r);
eventos[l] = r;
}
}
}
}
Comment
Your answer
Follow this Question
Related Questions
How to avoid reestablishing an HTTPS request, use Connection: Keep-Alive or reuse WWW object? 2 Answers
Does UnityWebRequest.Abort also dispose the request? 0 Answers
WWW. Print gives a 'Message Truncated' 1 Answer
What is the equivalent of unityWebRequest.downloadHandler.text when using WWW? 0 Answers