Solved

ASP.NET/VB: HttpWebRequest without errors

Posted on 2013-11-06
1
287 Views
Last Modified: 2013-11-06
What am I doing wrong?
<%@ Page Language="VB" %>
<%

 Dim request = HttpWebRequest.Create("http://www.example.com")
 Dim response = request.GetResponse()
 Response.write(response)

%>

Open in new window

0
Comment
Question by:hankknight
1 Comment
 
LVL 15

Accepted Solution

by:
pateljitu earned 500 total points
ID: 39628798
Please try this code change:

 <%
        Dim request = System.Net.HttpWebRequest.Create("http://www.example.com")
        Dim Objresponse = request.GetResponse()
        
        
        Dim webStream As System.IO.Stream = Objresponse.GetResponseStream() ' Get Response

        Dim reader As New System.IO.StreamReader(webStream)
        ' Read the content.
        Dim responseFromServer As String = reader.ReadToEnd()
        
        Response.Write(responseFromServer.ToString())

       Response.Write(Server.HtmlEncode(responseFromServer.ToString()))  ' Raw HTML
        %>

Open in new window

0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now