http - Post to Web Service from ASP, from Remote Server -
i'm trying post data web service, asp (vbscript), using createobject("microsoft.xmlhttp"). trick is, able post web service if resides on same server. moment post web service remote server or different server, assume if post data never got sent.
below example of function use post webservice. keep in mind works on local server, not on remote servers.
function httppostdata2(surl, srequest, data)
set ohttp = createobject("microsoft.xmlhttp")
ohttp.open "post", surl & srequest , false ohttp.setrequestheader "content-type", "application/x-www-form-urlencoded"
ohttp.send data httppostdata2 = ohttp.responsetext end function
url = apiurl & "myquery"
response.write(url & "
")
params = apikey & "myparameter=657407"
response.write(params & "
")
result = httppostdata2(url, null, params) response.write(result)
the problem might variation of xmlhttp object your're instantiating ohttp.
try this:
set ohttp = createobject("msxml2.serverxmlhttp")
Comments
Post a Comment