public IEnumerator FetchData(string url,WWWDataParseMethod callme){ SetLoadingActive (); WWW w = new WWW (url); yield return w; if (w.error == null) { callme (w.text); } else { print (url+" " +w.error); } SetLoadingInactive (); }
public IEnumerator FetchDataAuthPost(string url,WWWDataParseMethod callme,string authstring,string jsonString){ SetLoadingActive (); url = genBasicAuthURL(authstring , url); Hashtable headers = new Hashtable(); Hashtable postHeader = new Hashtable(); headers.Add("Content-Type", "text/json"); headers.Add("Content-Length", jsonString.Length); WWW w = new WWW (url,new System.Text.UTF8Encoding().GetBytes(jsonString),headers); yield return w; if (w.error == null) { callme (w.text); } else { print (url + " " + w.error); } SetLoadingInactive (); }
public void FetchDataAuth(string url,WWWDataParseMethod callme,string authstring){ url = genBasicAuthURL(authstring , url); StartCoroutine(FetchData (url, callme)); }