Skip to main content
October 22, 2009
Question

xml over http form post and response example

  • October 22, 2009
  • 1 reply
  • 742 views

can some one point me to http form post/get  syntax to send and receive xml...let me know

    This topic has been closed for replies.

    1 reply

    BKBK
    Community Expert
    Community Expert
    October 22, 2009

    Use the cfhttp tag. For example, suppose the xmlDoc is already defined. Then you could post the document using

    <cfhttp url="the_url" method="post">
        <cfhttpparam type="header" name="content-type" value="text/xml">
        <cfhttpparam type="header" name="content-length" value="#len(xmlDoc)#">
        <cfhttpparam type="header" name="charset" value="utf-8">
        <cfhttpparam type="xml" name="message" value="#xmlDoc#">
    </cfhttp>

    October 26, 2009

    how can i receive it.  can you give me an example thanks.

    BKBK
    Community Expert
    Community Expert
    October 26, 2009
    how can i receive it.  can you give me an example thanks.

    Here is an example directly form the web:

    <cfhttp url="http://www.funjunkie.co.uk/news.xml" method="GET" />
    <cfset newsXML = XMLParse(cfhttp.filecontent)>
    <cfdump var="#newsXML#">