Quick References
      ADO
      ASP
      CSS2
      HTML
      JavaScript
      Jet SQL
      VBScript
      WML
      WMLScript
      WSH
      XHTML
      XML DOM
      XSLT
  Features
      Ask DevGuru
      ASP Resources
      HTML Color Chart
      Find the Bug
      Knowledge Base
      Links
      Tips of the Week
      T-SQL Syntax Charts
      Tutorials
  Products
      dgCalendar
      dgCharge
      dgChart
      dgEncrypt
      dgFileUpload
      dgReport
      dgSort
      dgTree
  Site
      Authoring
      Coming Soon
      DevGuru Resume
      Errata
      Link to Us
      Merchandise
      Sponsorships
      Testimonials
      What's New
  Partners
      Code Project
      DevelopersDex
      Prog. Heaven
      Tek-Tips Forum
      TopXML
      VBXML.COM
      VisualBuilder.com
      W3Schools
      XMLPitstop
      ZVON.org
      Search Us!

       











METHOD:  HttpRequest::open

HttpRequest.open(Method, URL, Async, User, Password)

The open method initializes a Microsoft.XMLHTTP request, and specifies the method, URL and authentication information for the request. This method takes the following parameters:

  • Method
    This is a string specifying the method used to open the connection, such as GET, POST, PUT or PROPFIND.
  • Url
    This is a string of the requested URL. This can be either an absolute URL or a relative one.
  • Async
    This is a boolean value indicating whether the call is asynchronous. The default is true (the call returns immediately).
  • User
    This is the name of the user for authentication purposes. If the value is null or missing, and the site requires authentication, a logon window will be displayed.
  • Password
    This is a password for authentication. If the value of the 'User' parameter is null or missing, this parameter is ignored.

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.

The following example creates an HttpRequest object and uses the open method to synchronously open an ASP page. It then posts an XML document to that page, which in turn uses the loadXML method to load it.

Code (JScript):
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.open("POST", "http://guruserver/save.asp", false);
xmlhttp.send(xmldoc)





Copyright 1999-2002 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information