I have an asp function that makes use of the XMLHttpRequest object. This HTTP call to an external page takes a while to process. Despite setting the final parameter of this line
to false, ie don't make the call asynchronously and wait until the call returns before continuing, I still can see that the process often does not complete and that it returns to the calling ASP script and continues. So if this object does not wait, can I make this function wait or sleep?
Code:
objHTTP.open "POST", "[URL unfurl="true"]http://www.foobar.com",[/URL] False
to false, ie don't make the call asynchronously and wait until the call returns before continuing, I still can see that the process often does not complete and that it returns to the calling ASP script and continues. So if this object does not wait, can I make this function wait or sleep?
Code:
'Very often my foobar customer gets his boo value set but not his foo value as the foo() call does not get enough time to process.
' sets foo value to 'a'
foo(foobarid)
' sets boo value to 'b'
boo(foobarid)
Function foo(foobarid)
Set objHTTP = CreateObject("Microsoft.XMLHTTP")
objHTTP.open "POST", "[URL unfurl="true"]http://www.foobar.com",[/URL] False
objHTTP.setRequestHeader "Content-Type", "application/x-[URL unfurl="true"]www-form-urlencoded"[/URL]
objHTTP.send "foobarid=" & server.URLEncode(foobarid)
Set objHTTP = Nothing