Initializes a Microsoft.XMLHTTP request, and specifies the method, URL, and authentication information for the request. After calling this method, you must call send to send the request and data (if any) to the server.
Syntax
oXMLHttpRequest.open(Method, Url, Async, User, Password)
Parameters
Method
String. HTTP method used to open the connection, such as GET, POST, PUT, or PROPFIND.
Url
String. Requested URL. This must be an absolute URL, such as "http://Myserver/Mypath/".
Async
Boolean. Indicator of whether the call is asynchronous. The default is true (the call returns immediately).
User
Name of the user for authentication. If this parameter is NULL ("") or missing and the site requires authentication, the component displays a logon window.
Password
Password for authentication. This parameter is ignored if the user parameter is NULL ("") or missing.
Remarks
The values of the request headers, request body, response headers, and response body must be cleared before calling this method.
If the Async parameter is set to True, attach an onreadystatechange callback so you can tell when the send call has completed.
Example
The following JScript example creates an HTTPRequest object, then uses the Open method to synchronously open an ASP page. It then posts an XML document to an ASP page, which uses the loadXML method to load it.
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlHTTP.open("http://myserver/save.asp", false);
xmlHTTP.send(xmlDoc)
<% xmlDoc.loadXML(Request); %>
Applies To
See Also