I want to post XML data to an API and then read the response.
Could anybody point me to an example or show me the equivalent of this ASP code? Thanks!
Set objXMLHttp = Server.CreateObject("MSXML2.ServerXMLHTTP.3.0")
objXMLHttp.open "POST", strAPIUrl, false
' Post the XML body
objXMLHttp.setRequestHeader "Content-Type","application/x-www-form-urlencoded"
objXMLHttp.send ("qf=xml&xml=" & Server.URLEncode(strRequestXML))
If objXMLHttp.Status <> 200 Then
errMessage = "Error"
End If
Response
If objXMLHttp.status = 200 Then
Set objResponseXML = objXMLHttp.responseXML
Thanks!