Powered by Blogger.

Installing Dell OpenManage on ESX

Installing Dell Open Manage on ESX



Dell Open Manage on VMware ESXi

Read more...

How to use HttpWebRequest to send POST request to another web server

Yesterday we went to MySchools office. A big discussion was going on some database locking issue. It's interesting, their problem is application able to process two transaction successfully, from the third it is locking the table and execution is getting failed with timeout error. We asked to open the code, and we verified further. Finally I found the cause.  Close statement is missing in the code.  :-)

The Code which helped me to resolve the issue



private void OnPostInfoClick(object sender, System.EventArgs e)
{
string strId = UserId_TextBox.Text;
string strName = Name_TextBox.Text;

ASCIIEncoding encoding=new ASCIIEncoding();
string postData="userid="+strId;
postData += ("&username="+strName);
byte[] data = encoding.GetBytes(postData);

// Prepare web request...
HttpWebRequest myRequest =
(HttpWebRequest)WebRequest.Create("http://localhost/MyIdentity/Default.aspx");
myRequest.Method = "POST";
myRequest.ContentType="application/x-www-form-urlencoded";
myRequest.ContentLength = data.Length;
Stream newStream=myRequest.GetRequestStream();
// Send the data.
newStream.Write(data,0,data.Length);
newStream.Close();
}

Read more...

  © Blogger template Shush by Ourblogtemplates.com 2009

Back to TOP