Share via


open Method (IXMLHTTPRequest) (Windows CE 5.0)

Send Feedback

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

[Script]

Script Syntax

oXMLHttpRequest.open(bstrMethod,bstrUrl,varAsync,bstrUser,bstrPassword);

Script Parameters

  • bstrMethod
    String. HTTP method used to open the connection, such as GET, POST, PUT, or PROPFIND.
  • bstrUrl
    String. Requested URL. This must be an absolute URL, such as "http://Myserver/Mypath/Myfile.asp".
  • varAsync
    [optional] Boolean. Indicator of whether the call is asynchronous. The default is True (the call returns immediately). If set to True, attach an onreadystatechange property callback so that you can tell when the send call has completed.
  • bstrUser
    [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.
  • bstrPassword
    [optional] Password for authentication. This parameter is ignored if the user parameter is Null ("") or missing.

Script Return Value

None.

[C/C++]

C/C++ Syntax

HRESULT open(BSTRbstrMethod,BSTRbstrUrl,VARIANTvarAsync,VARIANTbstrUser,VARIANTbstrPassword);

C/C++ Parameters

  • bstrMethod
    [in] HTTP method used to open the connection, such as PUT or PROPFIND.
  • bstrUrl
    [in] Requested URL. This must be an absolute URL, such as "http://Myserver/Mypath/Myfile.asp".
  • varAsync
    [in, optional] Boolean. Indicator as to whether the call is asynchronous. The default is True (the call returns immediately). If set to True, attach an onreadystatechange property callback so that you can tell when the send call has completed.
  • bstrUser
    [in, 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.
  • bstrPassword
    [in, optional] Password for authentication. This parameter is ignored if the user parameter is Null or missing.

C/C++ Return Values

  • S_OK
    Value returned if successful.
  • E_FAIL
    Value returned if an error occurs.
  • E_INVALIDARG
    Value returned if bstrUrl or bstrMethod are NULL
  • E_OUTOFMEMORY
    Value returned if bstrMethod is unable to open connection.
  • E_ACCESSDENIED
    Value returned if bstrPassword is invalid.

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: Msxml2.h, Msxml2.idl.
Link Library: Uuid.lib.

General 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.

This method applies to the following interface:

IXMLHTTPRequest

See Also

abort Method | onreadystatechange Property

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.