To everyone:
below is a partial code that i am doing for parsing an html. this works fine on the first access. but at the second round it is hanging on getrequeststream(highligted in red). if there is anyone of you who have encounted this, please advise me of the solution.
Thank you so much.
Arequest.ContentType = "application/x-www-form-urlencoded"
Arequest.ContentLength = postData.Length
Arequest.Method = "POST"
Arequest.AllowAutoRedirect =
FalseArequest.Timeout = 100000
'adsasddf 'Dim sCookieContainer As CookieContainer 'Arequest.CookieContainer = New CookieContainer 'Dim requestStream As Stream = Arequest.GetRequestStream() Dim requestStream As StreamrequestStream =
NothingrequestStream = Arequest.GetRequestStream()
Dim postBytes As Byte() = Encoding.ASCII.GetBytes(postData)requestStream.Write(postBytes, 0, postBytes.Length)
requestStream.Close()
requestStream =
NothingAresponse =
CType(Arequest.GetResponse(), HttpWebResponse)
getrequeststream error
Chirag Rai
Guri
I'd also avoid ASCIIEncoding. This will break immediately once you want to post Latin 1 or other non-ASCII characters. Use UTF-8 or ISO-8859-1.
// UTF-8
Encoding enc = Encoding.UTF8;
or
// ISO-8859-1
Encoding enc = Encoding.GetEncoding(28591);