ASP.net VB.net read http response

Hi

I am using the the procedure below to read the response from a post that
I made to a URL.
THe following three lines only return a few characters. I am not sure that I am getting
everything from the response.
Is there a way to get more?from a site that returns hotel booking information. Thanks


The reason I ask is because this is
       Dim Answer As Stream = WebResp.GetResponseStream()
        Dim _Answer As New StreamReader(Answer)
        MsgBox(_Answer.ReadToEnd)

    Private Shared Sub start_get()
        'Our getVars, to test the get of our php.
        'We can get a page without any of these vars too though.
        Dim getVars As String = "?var1=test1&var2=test2"
        'Initialization, we use localhost, change if applicable

        Dim WebReq As HttpWebRequest = DirectCast(WebRequest.Create(String.Format("https://test.eres-dev.com/connect/eres/api/2008a", getVars)), HttpWebRequest)
        'This time, our method is GET.
        WebReq.Method = "GET"
        'From here on, it's all the same as above.
        Dim WebResp As HttpWebResponse = DirectCast(WebReq.GetResponse(), HttpWebResponse)
        'Let's show some information about the response
        Console.WriteLine(WebResp.StatusCode)
        Console.WriteLine(WebResp.Server)

        'Now, we read the response (the string), and output it.
        Dim Answer As Stream = WebResp.GetResponseStream()
        Dim _Answer As New StreamReader(Answer)
        MsgBox(_Answer.ReadToEnd)


        'Congratulations, with these two functions in basic form, you just learned
        'the two basic forms of web surfing
        'This proves how easy it can be.
    End Sub
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAsked:
Who is Participating?
 
CodeCruiserConnect With a Mentor Commented:
Split the string on VBCRLF.

For each Line As String in _Answer.ReadToEnd().Split(VBCRLF)
   msgbox Line
Next
0
 
CodeCruiserCommented:
>MsgBox(_Answer.ReadToEnd)

You are doing a readtoend which means you read the whole stream that was returned by the server.
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Thanks. What code would I use to read each line?
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Great. Thank you
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.