ASP: MSXML2.ServerXMLHTTP object question

Posted on 2011-10-10
Last Modified: 2012-05-12
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") "POST", url, false 
    xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" 
    xmlhttp.send "COMPANY="& request.form("company")
    pageContents = xmlhttp.responseText 

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.
Question by:nickgross19
    1 Comment
    LVL 11

    Accepted Solution

    try RESPONSE.write, rather than "document.write"...?


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
    I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    9 Experts available now in Live!

    Get 1:1 Help Now