Code
http://xxk45/demo_getLatestLeResult.php
Returned result:
I have Visual Studio 2010 and I want to write a C# program that will let me get the data.I am new to C# but have been a c , visual C, Visual C++ programmmer for many years.
I am pulling data from an SQL database but they have put an API on the server to filter the data for me.
-Phil

Philip Cannon5 reputationPosted Nov 11, 2010, 8:43 PM EST
public class PostURL : MonoBehaviour {
void Start () {
string url = "http://xxk45/demo_getLatestLeResult.php";
WWWForm form = new WWWForm();
form.AddField("var1", "value1");
form.AddField("var2", "value2");
WWW www = new WWW(url, form);
StartCoroutine(WaitForRequest(www));
}
IEnumerator WaitForRequest(WWW www)
{
yield return www;
// check for errors
if (www.error == null)
{ Debug.Log("WWW Ok!: " + www.data);
} else {
Debug.Log("WWW Error: "+ www.error);
}
}
}
Philip Cannon5 reputationPosted Nov 11, 2010, 8:55 PM EST
string url = "http://xxk45/demo_getLatestLeResult.php";
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream resStream = response.GetResponseStream();