I have this code and it works fine on my local machine. I moved it to our development server and when .Send is getting the error -2147483638 The data necessary to complete this operation is not yet available. Any ideas what could be different on the servers to cause this?
url = "https://auth.hstream.net/oauth2/token"
data = "grant_type=client_credentials"
Function PostTextFromUrl(url,authToken,data)
On Error Resume Next
Dim oXMLHTTP
Dim sHTTPResponse, sHTTPStatus
Set oXMLHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP.6.0")
oXMLHTTP.SetProxy 1
oXMLHTTP.SetTimeouts 600000, 600000, 600000, 600000
oXMLHTTP.Open "POST", url, False
oXMLHTTP.setRequestHeader "Authorization", authToken
oXMLHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
oXMLHTTP.Send data
response.write (Err.Number)
response.write (Err.description)
response.write (oXMLHTTP.status)
sHTTPStatus = oXMLHTTP.status
sHTTPResponse = oXMLHTTP.responseText
If Err.Number = 0 and sHTTPStatus = "200" and sHTTPResponse <> """{}""" Then
PostTextFromUrl = sHTTPResponse
Else
PostTextFromUrl = HTTPErrorHandeler (HTTPStatus, HTTPResponse)
End If
On Error Goto 0
Set oXMLHTTP = Nothing
Set oXMLHTTP = Nothing
End Function
I would expect the send to work. It works fine on my local machine.
Spottedbass is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
5
I was able to get to the error. -2147012851The certificate authority is invalid or incorrect
Then I was able to get that error resolved by adding the line:
oXMLHTTP.setOption 2, 13056 'http://msdn.microsoft.com/en-us/library/ms763811(v=VS.85).aspx
Spottedbass is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1