private float mJindu = 0;
private string mContent;
public float getJindu()
{
return mJindu;
}
IEnumerator POST(string url, Dictionary<string, string> post)
{
WWWForm form = new WWWForm();
foreach (KeyValuePair<string, string> post_arg in post)
{
form.AddField(post_arg.Key, post_arg.Value);
}
WWW www = new WWW(url, form);
yield return www;
mJindu = www.progress;
if (www.error != null)
{
mContent = "error :" + www.error;
}
else
{
mContent = www.text;
}
}
IEnumerator GET(string url, Dictionary<string, string> get)
{
string Parameters;
bool first;
if (get.Count > 0)
{
first = true;
Parameters = "?";
foreach (KeyValuePair<string, string> post_arg in get)
{
if (first)
first = false;
else
Parameters += "&";
Parameters += post_arg.Key + "=" + post_arg.Value;
}
}
else
{
Parameters = "";
}
testC ="getURL :" + Parameters;
WWW www = new WWW(url + Parameters);
yield return www;
mJindu = www.progress;
if (www.error != null)
{
mContent = "error :" + www.error;
}
else
{
mContent = www.text;
}
}