Hi all. I'm behind a firewall trying to connect to a remote site via
HttpWebRequest. My simple code is as follows:
Dim objRequest As HttpWebRequest = CType(WebRequest.Create
("http://xml.nada.com/default.asp"), HttpWebRequest)
objRequest.Method = "POST"
objRequest.ContentLength = strPost.Length
Dim myWriter As StreamWriter
Try
myWriter = New StreamWriter(objRequest.GetRequestStream())
myWriter.Close()
Catch objError As Exception
MyErrorMsg
Exit Sub
End Try
It errors on the objRequest.GetRequestStream as follows:
The underlying connection was closed: Unable to connect to the remote
server.
at System.Net.HttpWebRequest.CheckFinalStatus() at
System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult)
at System.Net.HttpWebRequest.GetRequestStream() at
Requests.JointInfo.DoJoint(Object sender, CommandEventArgs e) in
\\indlenders\DiBase\Requests\Requests\JointInfo.ascx.vb:line 295
Anyone have any idea why I'm having problems with GetRequestStream??
Thanks!!