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 Parse XMLHTTP Request???

Status
Not open for further replies.

sndkick

Programmer
Nov 1, 2000
71
0
0
US
Help!

I am using XMLHTTP to push data from one ASP page on one remote server to an ASP page on another server. The receiving page needs to accept the data and insert it into the database.

If I'm using XMLHTTP to shuttle the info to the remote server, how do I setup my receiving page to capture the data that is being sent and split into fields so that I can insert into my database?

Here's a snippet of my page that's SENDING the data:
--------------------------------------

strPost = "email=" & email & "&firstname=" & firstname & "&lastname=" & lastname

set xml = Server.CreateObject("Microsoft.XMLHTTP")
xml.open "POST", my_remote_server_url & "/saveXMLdata.asp", false
xml.send strPOST
response.write &quot;STATUS: &quot; & xml.Status & &quot;<HR>&quot;
response.write &quot;responseText: &quot; & xml.responseText
set xml = nothing


Any help would be greatly appreciated.

Thanks,
Scott
 
Found a solution that will actually work in this instance where i've only got a few fields and all data will fit in the query string...

- -- - -- --- -- - - - -
queryString = &quot;email=&quot; & email & &quot;&firstname=&quot; & firstname & &quot;&lastname=&quot; & lastname

set xml = Server.CreateObject(&quot;Microsoft.XMLHTTP&quot;)
xml.open &quot;GET&quot;, my_remote_server_url & &quot;?&quot; & queryString, false
xml.send
response.write &quot;STATUS: &quot; & xml.Status & &quot;<HR>&quot;
response.write &quot;responseText: &quot; & xml.responseText
set xml = nothing
- - - - -- - - - - - - -

So, this seems to work, and i'm able to grab the fields using:

request.querystring(&quot;email&quot;)

but does anyone have any idea how to do this with the POST method?

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top