Here is the code: the uri is an https - no error - the server I am
posting to simply says that there are no parameters being passed and
that causes the program on their end to return no data.
Function readHtmlPage(ByVal url As String, ByVal stufftopost As
String) As String
Dim proxyObject As WebProxy
proxyObject = New WebProxy("xxx.xxx.xxx.xxx", 8080)
proxyObject.BypassProxyOnLocal = True
GlobalProxySelection.Select = proxyObject
Dim cert As X509Certificate
cert = X509Certificate.CreateFromCertFile("c:\fdcert.cer")
Dim result As String = ""
Dim strPost As String = stufftopost
Dim myWriter As StreamWriter
Dim url2 As String
url2 = url & stufftopost
Dim objRequest As HttpWebRequest = WebRequest.Create(url)
objRequest.ClientCertificates.Add(cert)
objRequest.Method = "POST"
objRequest.ContentLength = strPost.Length
objRequest.ContentType = "application/x-www-form-urlencoded"
Try
myWriter = New StreamWriter(objRequest.GetRequestStream
())
myWriter.Write(strPost)
Catch e As Exception
Return e.Message
Finally
myWriter.Close()
End Try
Dim objResponse As HttpWebResponse = objRequest.GetResponse()
Dim sr As StreamReader
sr = New StreamReader(objResponse.GetResponseStream())
result = sr.ReadToEnd()
sr.Close()