31May/100
POST using ASP
A more simple way to to a POST. This is cleaner than the last example I created.
I used a nice function at http://www.secretgeek.net/XMLSendReceive.shtml.
' First load the XML to send off
Set SendDoc = server.createobject("Microsoft.XMLDOM")
SendDoc.ValidateOnParse= True
SendDoc.LoadXML(sTrData)
' Then call the POST function and get a nice object back
set SourceObj = xmlSend (sURL, SendDoc)
Reading the XML:
set oUid = SourceObj.documentElement.selectSingleNode("//UserId")
set oHtml = SourceObj.documentElement.selectSingleNode("//User/Name")
Here is the nifty little function
private function xmlsend(url, docSubmit)
Set poster = Server.CreateObject("MSXML2.ServerXMLHTTP")
poster.open "POST", url, false
poster.setRequestHeader "CONTENT_TYPE", "text/xml"
poster.send docSubmit
Set NewDoc = server.createobject("Microsoft.XMLDOM")
newDoc.ValidateOnParse= True
newDoc.LoadXML(poster.responseTEXT)
Set XMLSend = NewDoc
Set poster = Nothing
end function