Hi all,
I'm trying to post to a webpage using WebClient in C#. Somehow the parameters are not coming through. The page itself is a php page. I've tested the same page with a regular browser/html page and then it works, so I'm expecting that it is a client issue
Can anybody tell me what I might be doing wrong?
WebClient myClient = new WebClient();
myClient.Headers.Add("Content-Type", "application/x-www-form-urlencoded");
try
{
NameValueCollection keyvaluepairs = new NameValueCollection();
keyvaluepairs.Add("request", "foo");
byte[] responseArray = myClient.UploadValues("http://www.motio.com/test.php?id=7", "POST", keyvaluepairs);
string response = Encoding.ASCII.GetString(responseArray);
}
catch (Exception e)
{
}