Hi, I am newbie to scripting.
I had a web service where i can enter an id and retrieve data from database. So I want to enter access the web service through Unity and enter the id.
When i run the code, the debug log show me this message:WWW.Error:500 Internal Server Error.
But when I remove the form from my www, the error message not showing again.
It seems my AddField part have some problem but i don’t know why.
Can someone point out what is going wrong in my code?
Sorry if my English grammar not good.
Here is my code:
void Start()
{
WWWForm form = new WWWForm();
string url = "http://localhost:54659/WebService.asmx?op=RecipeID";
form.AddField("id", 1);
WWW www = new WWW(url, form);
StartCoroutine(WaitForRequest(www));
}
IEnumerator WaitForRequest(WWW www)
{
yield return www;
if (www.error == null)
{
Debug.Log("WWW of!:" + www.text);
}
else
{
Debug.Log("WWW.Error:" + www.error);
}
}