Link to home
Start Free TrialLog in
Avatar of nickgross19
nickgross19

asked on

ASP: MSXML2.ServerXMLHTTP object question

I am using classic ASP and I am trying to pull the HTML from a URL with the following code:

url = "URL GOES HERE" 
    set xmlhttp = CreateObject("MSXML2.ServerXMLHTTP") 
    xmlhttp.open "POST", url, false 
    xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" 
    xmlhttp.send "COMPANY="& request.form("company")
    pageContents = xmlhttp.responseText 
    document.write(pageContents)

Open in new window


When I try to out put pageContents in a response.Write(pageContents) i get the following error:

Microsoft VBScript runtime error '800a01a8'

Object required: ''

I upload the code to a different domain and when I execute it, the code successfully pulls the HTML from the url i provide, but when I upload the code to this problem website, it does not work.
ASKER CERTIFIED SOLUTION
Avatar of G_H
G_H
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial