Solved

How can I make an HTTP request from WITHIN an ASP script

Posted on 2004-09-24
7
250 Views
Last Modified: 2006-11-17
This may seem an odd thing to want to do, but it is possible to make an HTTP POST or GET to another web server from within an ASP script, then recieve & parse the result within ASP?

The actual requirement is to upload two files to a remote server via HTTP, then to download and parse (within the script) the file that is returned.  The contents of this file will be used within the script to produce the final output to the client.

Does anyone know of any way this can be achieved?  Ideally, with a code sample.

Thanks in advance
0
Comment
Question by:DrBeaker
  • 4
  • 3
7 Comments
 
LVL 8

Expert Comment

by:a_twixt_in_the_tale
ID: 12141293
user Server.CreateObject("Microsoft.XMLHTTP")
0
 
LVL 2

Author Comment

by:DrBeaker
ID: 12141329
Could you elaborate and ideally provide a code sample
0
 
LVL 8

Expert Comment

by:a_twixt_in_the_tale
ID: 12141369
<%
      Set xml = Server.CreateObject("Microsoft.XMLHTTP")
      xml.Open "GET", "http://www.google.com/", False
      xml.Send
      response.write(xml.responseText)
%>
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 2

Author Comment

by:DrBeaker
ID: 12141550
:) OK

Actually I have been searching google & MS re this since your first (very helpful) post with mixed results.  Where is this component documented?  I've been able to find references to the docs but no actual docs.

How would I upload & download files?

Sorry to me so demanding, but ASP is very new to me.

0
 
LVL 8

Accepted Solution

by:
a_twixt_in_the_tale earned 250 total points
ID: 12142757
> Where is this component documented?
Dunno exactly. its part of Microsoft's XML parser. should b there in C:\Program Files\MSXML 4.0\doc\xmlsdk.chm sumwhere or msxml 3.0 if u use that

try http://www.4guysfromrolla.com/webtech/110100-1.shtml should b good

> How would I upload & download files?
Getting Binary Data is there in http://www.4guysfromrolla.com/webtech/110100-1.shtml
Uploading files u hv loadsa cmpts, i hvnt used any though, so any of my suggestions on that would be all hot air. :)

:)
Don
0
 
LVL 2

Author Comment

by:DrBeaker
ID: 12142931
Thanks for the help.  I've doubled the points for a very prompt, helpful and interactive response.

Cheers Don.

Dave
0
 
LVL 8

Expert Comment

by:a_twixt_in_the_tale
ID: 12143275
Thnx!
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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 have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

816 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

7 Experts available now in Live!

Get 1:1 Help Now