(Classic ASP) HTTP Post XML
Demonstrates how to POST XML to a website.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
' This example assumes the Chilkat API to have been previously unlocked.
' See Global Unlock Sample for sample code.
' For versions of Chilkat < 10.0.0, use CreateObject("Chilkat_9_5_0.Http")
set http = Server.CreateObject("Chilkat.Http")
' Make sure to replace the URL with something real...
url = "https://example.com/example.asp"
xmlBody = "<test>This is the XML to be sent</test>"
' resp is a Chilkat.HttpResponse
Set resp = http.PostXml(url,xmlBody,"utf-8")
If (http.LastMethodSuccess = 0) Then
Response.Write "<pre>" & Server.HTMLEncode( http.LastErrorText) & "</pre>"
Else
' Examine the body of the response.
Response.Write "<pre>" & Server.HTMLEncode( resp.BodyStr) & "</pre>"
End If
%>
</body>
</html>
|