Posting Special charectors using HttpWebRequest
Hi,
I am using HttpWebequest. When i post text/HTML containing special charectors like "#" , post is successfully done.
Can anybody help me?
I am using following code,
string strURL = "some text with special charectors";
HttpWebRequest HWReq = (HttpWebRequest)WebRequest.Create(strURL);
HWReq.Timeout = (int)cbTimeout.SelectedItem * 1000;
HWReq.UserAgent = "Mozilla/4.0 (compatible;MSIE 6.0b;Windows NT 5.0)";
HWReq.AllowAutoRedirect = true;
HWReq.Method = "POST";
HWReq.ContentType = "application/x-www-form-urlencoded";
HWReq.CookieContainer = new CookieContainer();
HWReq.CookieContainer.Add(ccLogin1);
HttpWebResponse HWResp = (HttpWebResponse)HWReq.GetResponse();
I am getting Error in the above last line.
Thanks,
Kiran Suthar.