I am trying to send data to a HTTP server from within a Extra script.I need to reference "Microsoft WinHTTP Services winhttp.dll)"
I want to be able to access the the WinHTTP WinHttpRequest COM object.
When I compile the script below ,it errors at ( Set HttpReq = New WinHttpRequest )
The error = ‘WinHttpRequest’ is not a class
I know I need to reference winhttp.dll in a declare sub statement but I am not sure of the syntax.
Declare Sub name [libSpecification] [(parameter[As type][,...])]
Does anyone have any ideas?
=======================================================
Sub
Dim HttpReq As Object
Dim strTo As String
Dim strFrom As String
Dim strUserMessage As String
Dim strXmlMsg As String
strTo = "ab5835"
strFrom = "test.bot"
strUserMessage = "This is a test message”
strXmlMsg = "xmlMessage=<message type=""contact.send.message"" id=""" & strFrom
strXmlMsg = strXmlMsg & """ contactId=""" & strTo
strXmlMsg = strXmlMsg & """><statement from=""" & strFrom
strXmlMsg = strXmlMsg & """ to=""" & strTo
strXmlMsg = strXmlMsg & """ text=""" & strUserMessage
strXmlMsg = strXmlMsg & """/></message>"
' Initialize the WinHTTPRequest Object.
* Set HttpReq = New WinHttpRequest
HttpReq.Open "GET", " & strXmlMsg, False
' Send data to the HTTP server.
HttpReq.Send
'Cleanup
Set HttpReq = Nothing
End Sub
I want to be able to access the the WinHTTP WinHttpRequest COM object.
When I compile the script below ,it errors at ( Set HttpReq = New WinHttpRequest )
The error = ‘WinHttpRequest’ is not a class
I know I need to reference winhttp.dll in a declare sub statement but I am not sure of the syntax.
Declare Sub name [libSpecification] [(parameter[As type][,...])]
Does anyone have any ideas?
=======================================================
Sub
Dim HttpReq As Object
Dim strTo As String
Dim strFrom As String
Dim strUserMessage As String
Dim strXmlMsg As String
strTo = "ab5835"
strFrom = "test.bot"
strUserMessage = "This is a test message”
strXmlMsg = "xmlMessage=<message type=""contact.send.message"" id=""" & strFrom
strXmlMsg = strXmlMsg & """ contactId=""" & strTo
strXmlMsg = strXmlMsg & """><statement from=""" & strFrom
strXmlMsg = strXmlMsg & """ to=""" & strTo
strXmlMsg = strXmlMsg & """ text=""" & strUserMessage
strXmlMsg = strXmlMsg & """/></message>"
' Initialize the WinHTTPRequest Object.
* Set HttpReq = New WinHttpRequest
HttpReq.Open "GET", " & strXmlMsg, False
' Send data to the HTTP server.
HttpReq.Send
'Cleanup
Set HttpReq = Nothing
End Sub