Solved

ASP.NET/VB: HttpWebRequest without errors

Posted on 2013-11-06
1
293 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Forrester Webinar: xMatters Delivers 261% ROI

Guest speaker Dean Davison, Forrester Principal Consultant, explains how a Fortune 500 communication company using xMatters found these results: Achieved a 261% ROI, Experienced $753,280 in net present value benefits over 3 years and Reduced MTTR by 91% for tier 1 incidents.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

731 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