- Home /
WWW : Waiting for response from server
Hi All,
i am working on a version check API but somehow i am not able to get any response back(no error no result)
Here is the code
IEnumerator CheckVersion()
{
WWWForm form = new WWWForm();
form.AddField("version","0.26");
string url = "http://game.com/versioncheck.php";
WWW w = new WWW(url, form);
Gtex.text = "Waiting for response....";
yield return w;
Debug.Log(w.text);
string versionResult = w.text;
if(versionResult != "1")
{
Debug.Log("We got response but version didn't match");
}
else
{
Debug.Log("version matched test succesfull");
}
if(w.error != null)
Debug.Log("There was an error checking the version: " + w.error);
}
void OnGUI()
{
if(GUI.Button(new Rect(10,10,100,40),"Login"))
StartCoroutine(CheckVersion());
}
i googled the same issue and what people pointed out is, if you don't give a yield then it gives this particular error, but i don't think i a m making that mistake here.
I also checked the API call outside unity just to check if there was something wrong with the API itself, but it wasn't the case it is giving me the right response outside unity.
Can someone please help me out with this.
P.S : this is not a cross domain issue : i already crosschecked that
Answer by crazy_boy_02 · Jul 19, 2013 at 07:56 AM
i figured out the issue, there was nothing wrong with the code the issue was coming because the crossdomain.xml file placed on the server had some BOM characters which was causing this issue.
http://docs.unity3d.com/Documentation/Manual/SecuritySandbox.html
Your answer
Follow this Question
Related Questions
Coroutine for WWW call not resuming 0 Answers
Calling API via proxy 0 Answers
Is pulling and parsing XML data from 3rd party API call possible? 1 Answer
Use the data received from WWW in UI 1 Answer