Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to make Web request from asp

Status
Not open for further replies.

sutav

Programmer
Jun 23, 2003
3
0
0
UA
Hi all,
if anybody knows how I can make a request to other page (php in my case) and to get response help please. There is such possibility in ASP.NET but I can't find anything appropriate in asp.
To make things more clear - there is php script hosted on other server accepting parameters in query string and returning data in xml format. I need to call it within server side code of asp page.

Any help will be appreciated
 
here's a snippet of code i've used to do this:
note that myXmlOutputString should be valid xml.

Code:
Dim xmlResponse, htobj
Set htobj = Server.Createobject("MSXML2.ServerXMLHTTP")
htobj.Open "POST", "[URL unfurl="true"]http://example.com/somepage.php",[/URL] false
htobj.setRequestHeader "Content-Type", "text/xml"			' windows implementation is case-sensitive!!
htobj.Send myXmlOutputString
xmlResponse = htobj.ResponseText
Set htobj = Nothing

now feel free to parse away---or even better, use the Microsoft.XMLDOM object---at your xmlResponse string.

good luck!
-f!
 
Thanks everybody,
Though I have find a good example in msdn
just before your replies were posted I appreciate a lot your help.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top