Click to return to the XML (Extensible Markup Language) home page    
XMLHttpRequest getRespons...     XMLHttpRequest readyState...     XMLHttpRequest Object    
Web Workshop  |  XML (Extensible Markup Language)

open Method


Initializes a Microsoft.XMLHTTP request, and specifies the method, URL, and authentication information for the request.

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.

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

[ Object Name ]
PlatformVersion
Win16:
Win32:
Mac:
Unix:
WinCE:
XMLHttpRequest

See Also

abort



Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.