Found it:
Dim uri As String = "http://127.0.0.1:4012"
Dim postString As String = myXMLString
' Create a new WebClient instance.
Dim myWebClient As New WebClient
myWebClient.Headers.Add("Content-Type",
"application/x-www-form-urlencoded")
Dim response As String =
Encoding.UTF8.GetString(myWebClient.UploadData(uri , "POST",
Encoding.UTF8.GetBytes(postString)))
MsgBox(response)
I hope this is a good usage of the webclient. Thank you both
"Philip Wagenaar" wrote:
I found the webclient class and the openread and openwrite.
Openwrite can be used to data, but how do I receive the response? Openread
only requests a document.
"Curtis" wrote:
Phillip,
You might want to look at the following example on MSDN:
http://msdn.microsoft.com/library/de...treamtopic.asp
I don't have any experience pointing to a TCP/IP port other than the default
HTTP port 80 but you should be able to modify that as well in that class.
You also might want to check out the WebClient class which is similar to the
HTTPResponse/Request class @
http://msdn.microsoft.com/library/de...classtopic.asp.
Hopefully, that should point you in the right direction.
Curtis
"Philip Wagenaar" <ph*************@online.nospam> wrote in message
news:52**********************************@microsof t.com...I need to communicate with a service that listens on a specific TCP/IP
port.
I need to send an XML document using POST commands.
I know I need to use System.Net.HttpWebRequest and
System.Net.HttpWebResponse, but I am not sure how to use them.