public void SendDataToXYZ(string FirstName, string LastName, string Email)
{
string strURL = null;
string strResponse = null;
string posturl = null;
posturl = "http://localhost/test.aspx";
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(posturl);
req.Method = "POST";
req.ContentType = "application/x-www-form-urlencoded";
strURL = "inf_form_xid=" + "7b8652461a3af9d6f219414b2d7f15fb" + "&inf_field_FirstName=" + FirstName + "&inf_field_LastName=" + LastName + "&inf_field_Email=" + Email;
req.ContentLength = strURL.Length;
StreamWriter stOut = new StreamWriter(req.GetRequestStream(), System.Text.Encoding.ASCII);
stOut.Write(strURL);
stOut.Close();
// Do the request to get the response
StreamReader stIn = new StreamReader(req.GetResponse().GetResponseStream());
strResponse = stIn.ReadToEnd();
stIn.Close();
}
Like this:
Like Loading...