0

Im trying to create a HttpRequest using asp.net with this simple code:

    Dim request As HttpWebRequest = HttpWebRequest.Create(url)
    request.Credentials = CredentialCache.DefaultCredentials
    Dim responsee As HttpWebResponse = request.GetResponse() ''Fell
    Dim dataStream As Stream = responsee.GetResponseStream()
    Dim reader As New StreamReader(dataStream)
    Dim html As String = reader.ReadToEnd()
    reader.Close()
    responsee.Close()

the code works fine, but the web sites im trying to get with this code doesnt get the full answer.

For example: Travelocity (this link will take you seaching flighs between New York and Los angeles. what actually happens, that the request return as finish quite fast, but in the meanwhile the search is working, and just after few second later the page is finished his load.

When im using the code above, im getting the first response which is incomplete.

How can i solve this? can i set the request object with waiting time to assure the full response? or is there any other solution for sites like this?

Thank you.

Darren Wainwright
  • 30,247
  • 21
  • 76
  • 127

0 Answers0