Microsoft XML SDK 2.6 - XML Reference

open Method

Initializes an Msxml2.XMLHTTP request and specifies the method, URL, and authentication information for the request.

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 [optional]
Boolean. Indicator of whether the call is asynchronous. The default is True (the call returns immediately). If set to True, attach an onreadystatechange callback so that you can tell when the send call has completed.
user [optional]
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 [optional]
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.

After calling this method, you must call send to send the request and data (if any) to the server.

Example

The following JScript example creates an HttpRequest object, and 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("Msxml2.XMLHTTP");
xmlHTTP.open("http://myserver/save.asp", false);
xmlHTTP.send(xmlDoc)
<% xmlDoc.loadXML(Request); %>

See Also

abort Method

Applies To: XMLHttpRequest Object