DotNetNewsgroup.com  
web access to complete list of Microsoft.NET newsgroups
   home   |   control panel login   |   archive  |  
 
  carried group
academic
adonet
aspnet
aspnet.announcements
aspnet.buildingcontrols
aspnet.caching
aspnet.datagridcontrol
aspnet.mobile
aspnet.security
aspnet.webcontrols
aspnet.webservices
assignment_manager
datatools
dotnet.distributed_apps
dotnet.general
dotnet.myservices
dotnet.nternationalization
dotnet.scripting
dotnet.security
dotnet.vjsharp
dotnet.vsa
dotnet.xml
dotnetfaqs
framework
framework.clr
framework.compactframework
framework.component_services
framework.controls
framework.databinding
framework.drawing
framework.enhancements
framework.interop
framework.odbcnet
framework.performance
framework.remoting
framework.sdk
framework.setup
framework.webservices
framework.windowsforms
framework.wmi
frwk.windowsforms.designtime
lang.csharp
lang.jscript
lang.vb
lang.vb.controls
lang.vb.data
lang.vb.upgrade
lang.vc
lang.vc.libraries
  
 
start date: Mon, 06 Aug 2007 09:09:59 -0700,    posted on: microsoft.public.dotnet.framework        back       

Thread Index
  1    unknown


HttpWebRequest problem   
I use the HttpWebRequest class in VB.Net to return HTML from a page on
a remote server. The code works correctly on my machine and on another
server (the code extracts the HTML from the same location on the
remote server), but if I run the code on the server itself I receive
an unspecified error. The code that I use is as follows (url is
replaced with the correct website address on the server).

Dim Req As HttpWebRequest = CType(WebRequest.Create(url), WebRequest)
Req.ProtocolVersion = HttpVersion.Version11
Req.Method = "GET"
Req.Accept = "*/*"
Req.Credentials = CredentialCache.DefaultCredentials
result = Req.GetResponse()

I have checked the server variables to ensure that Version 11 is the
correct ProtocolVersion. Is there a setting on the server that needs
to be changed to allow it to make web requests, or are there
alterations that need to be made to my code?

Thanks in advance for all help.
Date:Mon, 06 Aug 2007 09:09:59 -0700   Author:  

Google
 
Web dotnetnewsgroup.com


COPYRIGHT ?2005, EUROFRONT WORLDWIDE LTD., ALL RIGHT RESERVE  |   Contact us