以下是要点:
我想在asp中进行一次调用,但我不关心响应。我只想触发调用,而且我不希望页面等待响应。根据文档,代码应该类似于这样:
dim xmlhttp : set xmlhttp = Server.CreateObject("MSXML2.ServerXMLHTTP")
xmlhttp.Open "POST", url, true '' setting the 'asynchronous' option to 'true'
xmlhttp.setRequestHeader "Content-Type", "application/soap+xml; charset=utf-8"
xmlhttp.setRequestHeader "Content-Length", Len(XMLData)
xmlhttp.send XMLData
当同步调用时,这很完美,但当我将“ansynchronous”选项翻转为“true”时,没有任何反应。从互联网上可以得知,用户会执行以下操作:
While xmlhttp.readyState <> 4
xmlhttp.waitForResponse 1000
Wend
如果你在等待响应,这似乎不再是异步调用了,难道我疯了吗?
将xmlhttp.waitForResponse 1
放在发送后面会导致请求被触发,但是我不想等一秒钟。
有什么想法吗?