posting data to another url using webclient
-
Hi, Im writing a component for posting data to a webserver. http://www.domainname.com/fire/incoming.asp?user=xxxx&pass=xxxx&amount I tried using HttpWebrequest & Webclient to post data but it is returning an error if i paste the url in the browser it is working properly The code goes here ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ string User = "test3"; string Pass = "test3"; string amount = Server.UrlEncode(TextBox2.Text); string MobileNumber = "91"+TextBox1.Text; string postData = ("login="+User); postData += ("&pass="+Pass); postData += ("&amount="+amount); string uriString = "http://www.domainname.com/fire/incoming.asp"; WebClient myWebClient = new WebClient(); myWebClient.Headers.Add("Content-Type","application/x-www-form-urlencoded"); byte[] byteArray = Encoding.ASCII.GetBytes(postData); byte[] responseArray = myWebClient.UploadData(uriString,"POST",byteArray); lblStatus.Text = Encoding.ASCII.GetString(responseArray); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Can someone help ..... Thanks in advance Abraham