Pintoo Yadav

Pintoo Yadav

  • NA
  • 2.1k
  • 403.3k

how to send data post Request in asp.net my code here:

Nov 14 2017 4:41 AM
public void post(string a, string b, string c, string d)
{
ASCIIEncoding encoding = new ASCIIEncoding();
string postData = "code=" + a;
postData += ("&a=" + b);
postData += ("&b=" + c);
postData += ("&c=" + d);
byte[] data = encoding.GetBytes(postData);
HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("https://codbazar.com/POPAuthenticate");
myRequest.Method = "POST";
myRequest.ContentType = "application/x-www-form-urlencoded";
myRequest.ContentLength = data.Length;
Stream newStream = myRequest.GetRequestStream();
newStream.Write(data, 0, data.Length);
newStream.Close();
Response.Redirect("https://codebazar.com/POPAuthenticate?" + postData);
// HttpHelper.RedirectAndPOST(this.Page, "https://codebazar.com/POPAuthenticate", postData);
}

Answers (4)