Receiving a web response asynchronously

P

PeterK

With the code below, which I copied from the MSDN, I am getting only part of
the the web-page 'MyUrl' returned (this is a synchronoues access).
My hunch is that I have to use asynchronous access, which requires the use
of IAsynchResult - besides other things.
Does anyone have or can anybody point to code for this, please?!
TIA

Dim request As HttpWebRequest = CType(WebRequest.Create(MyUrl),
HttpWebRequest)
' Set some reasonable limits on resources used by this request
request.MaximumAutomaticRedirections =12
request.MaximumResponseHeadersLength = 12
' Set credentials to use for this request.
request.Credentials = CredentialCache.DefaultCredentials
Dim response As HttpWebResponse = CType(request.GetResponse(),
HttpWebResponse,True)
 
J

Joseph Bittman MCSD

August 7, 2005

I doubt that it would make a difference being Async vs Synch. My thought
is maybe the web request is timing out before the full request is filled and
the partial request is sent back. Or maybe there is something in the
HTML|Code returned that makes it think that it is done? Hope this helps and
have a great day!

--
Joseph Bittman
Microsoft Certified Solution Developer

Web Site: http://71.39.42.23
Static IP
 
P

PeterK

Yes, that helped: The URL had a wrong parameter which made it get a shorter
response.
The question that remains, though, is:"If the web request (this client)
times out, how to lengthen the timeout interval?".
In which cases would an aysnchronous connection be needed?
Thank you.
 
G

Guest

The question that remains, though, is:"If the web request (this client)
times out, how to lengthen the timeout interval?".

request.Timeout = 30000 ' 30 seconds
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top