Results 1 to 4 of 4

Thread: XMLHTTP Object

  1. #1
    Mike H. Guest

    Default XMLHTTP Object

    How can you pass name/value pairs from a search form to the line<BR><BR>xml.send "some_name=some_value" <BR><BR>when using POST to request pages from another web site as described in the WebWeekly Newsletter on the XMLHTTP Object by Richard Lowe?<BR><BR>Also how do you open a page with relative URLs for the HREFs when using the XMLHTTP Object to get the correct address for the page?

  2. #2
    Mamata Tripathy Guest

    Default RE: XMLHTTP Object

    Hi Mike,<BR><BR>Could you please tell me what I am doing wrong in the code below.<BR><BR>&#060;%@ LANGUAGE="VBSCRIPT" %&#062;<BR>&#060;%Option Explicit%&#062;<BR>&#060;%<BR>Dim XMLObj<BR>Set XMLObj = Server.CreateObject("Microsoft.XMLHTTP")<BR>XMLObj .Open "GET", "http://www.4Guysfromrolla.com/", False<BR>XMLObj.send<BR>Response.Write XMLObj.responseText <BR>Set XMLObj = Nothing<BR>%&#062;<BR><BR>It does not give any error while creating an instance. But when I call the open method, It gives the following error.<BR><BR>error &#039 80004005&#039 <BR>Unspecified error <BR><BR>/backoffice/mtest/xmlhttp.asp, line 6 <BR><BR>I thought it might be due to the version. <BR>I checked for the version of MSXML.dll. It is 5.00.2919.6303 in my machine.<BR><BR>Please help and thanks in advance.<BR><BR>Mamata

  3. #3
    Richard A. Lowe Guest

    Default RE: XMLHTTP Object

    Hi Mike, <BR><BR>You want to take form values on your site and post them to another site via XMLHttp? That should be an easy matter of replicating the form from the original site, capturing the data on your ASP page and then, just as you have above, placing the values in pairs with the send method:<BR><BR>xml.send "somevar=" & Request.Form("somevar") & "&othervar=10"<BR><BR>Opening relative URLs could be a bit more of a challenge. You would have to replace &#060;a href="test.asp"&#062; with something like &#060;a href="GetHTTP.asp?site=http://www.somesite.com&URL=test.asp"&#062; where GetHTTP.asp is YOUR page that accepts the site and URL querystring value then used to go get the relative URL through your site.<BR><BR>You can use this: http://www.aspfaqs.com/aspfaqs/ShowFAQ.asp?FAQID=66 to replace the instances of &#060;a href&#062;.<BR><BR>HTH,<BR>Richard

  4. #4
    Mike H. Guest

    Default RE: XMLHTTP Object

    There is 1 thing that I see that could be the problem, although I am not an XML expert and am very new to it myself. There is no filename specified. You are requesting <BR><BR>http://www.4guysfromrolla.com/ <BR><BR>If you are trying to get the homepage, the full address is: <BR><BR>http://www.4guysfromrolla.com/webtech/index.shtml<BR><BR>Give that a try. Good luck.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts