DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: POST with XMLHTTPRequest Component?

  1. #1
    Kris Guest

    POST with XMLHTTPRequest Component?


    I'm having some real problems sucessfully posting to an ASP page with the
    XMLHTTPRequest object. I open the page using:

    objXMLHTTP.open "POST", PageURL, "", ""

    then I'm trying to insert my page parameters into the header, and this is
    where I'm missing something... I don't know the correct bstr name of the
    parameter to tell the ASP page that this is POST data. I know there must
    be some sort of content-type value that it needs to know how to interpret
    it on the ASP side. With Cookies, you go...

    objXMLHTTP.setRequestHeader "Cookie", "cookie1=value;cookie2=value2"

    I just don't know the correct name, I believe that I need to do something
    like:

    objXMLHTTP.setRequestHeader "??????", "name=username&pass=userpassword"
    objXMLHTTP.send

    Can anyone help on this?

    Thanks,

    Kris

  2. #2
    steve Guest

    Re: POST with XMLHTTPRequest Component?


    Hi Kris,
    is this what you are looking for?
    Seve,
    http://www.xmldir.com
    **************************************************
    open Method
    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.

    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.


    "Kris" <krs_goss@yahoo.com> wrote:
    >
    >I'm having some real problems sucessfully posting to an ASP page with the
    >XMLHTTPRequest object. I open the page using:
    >
    >objXMLHTTP.open "POST", PageURL, "", ""
    >
    >then I'm trying to insert my page parameters into the header, and this is
    >where I'm missing something... I don't know the correct bstr name of the
    >parameter to tell the ASP page that this is POST data. I know there must
    >be some sort of content-type value that it needs to know how to interpret
    >it on the ASP side. With Cookies, you go...
    >
    >objXMLHTTP.setRequestHeader "Cookie", "cookie1=value;cookie2=value2"
    >
    >I just don't know the correct name, I believe that I need to do something
    >like:
    >
    >objXMLHTTP.setRequestHeader "??????", "name=username&pass=userpassword"
    >objXMLHTTP.send
    >
    >Can anyone help on this?
    >
    >Thanks,
    >
    >Kris



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center