Posting XML With ColdFusion, CFHttp, And CFHttpParam

<!--- Get the URL. --->
<cfset strURL = (
	CGI.server_name &
	GetDirectoryFromPath( CGI.script_name ) &
	"cfhttp_catch.cfm"
	) />
 
 
<!--- Create the XML data to post. --->
<cfsavecontent variable="strXML">
 
	<transaction>
		<type>Debit</type>
		<cost>19.99</cost>
		<date>06-01-2007</date>
		<item>
			<sku>GGW190034394</sku>
			<name>Girls Gone Wild Vol. 13</name>
		</item>
	</transaction>
 
</cfsavecontent>
 
 
 
<!---
	Post the XML data to catch page. We are going
	to post this value as an XML object will actually
	just post it as an XML body.
--->
<cfhttp
	url="#strURL#"
	method="POST"
	useragent="#CGI.http_user_agent#"
	result="objGet">
 
	<!---
		When posting the xml data, remember to trim
		the value so that it is valid XML.
	--->
	<cfhttpparam
		type="XML"
		value="#strXML.Trim()#"
		/>
 
</cfhttp>
 
 
<!--- Output the return message. --->
Message: #objGet.FileContent#

For Cut-and-Paste