pXML= Product_Request
set http= server.Createobject("MSXML2.ServerXMLHTTP")
http.Open "GET", "http://test.com/Data_Check/Request.asp?XML_File=" & pXML , False
http.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
http.send
I need to send request with above asp code for the above URL. But i no need response from that server.
After sending the request, it waits for the response. How do I write this so that it doesn't block while waiting for the response?
I don't believe there is a way to determine that your request was successful without a response. So what's to determine the difference between no response and complete failure?
Change your Open request to Asynchronous (i.e. 3rd parameter to True). This will allow you to submit two requests at the same time. Then you get wait for both responses to arrive.
You may be able to use the WinHTTPRequest object directly instead (this is what underlies ServerXMLHTTP). It has an additional method which might be useful the
WaitForResponse
method.Note the
Open
method hastrue
for itsasync
parameter. In this caseSend
will return as soon as the request has been sent but before any response has been recieved. You can now do other things like make your other request in a normal synchronous manner. Once done you can make sure that the orginal request has completed by callingWaitForResponse
.CAVEATs
Open
might complain that the script environment doesn't "do asynchronous calls".