-1

I am trying to read XML feed from this URL using cfhttp tag in coldfusion

and i an using this code for it

<cfhttp url="https://architechsfortheweb.com/blogfeed/" method="GET" resolveurl="Yes" >
    <cfhttpparam type="header" name="Content-Type" value="application/xml ">
    <cfhttpparam type="header" name="mimetype" value="application/xml" />
    <cfhttpparam type="header" name="Accept" value="application/xml ">
</cfhttp>

<cfset feedData = CFHTTP.FileContent>
<cfset xmlData = XMLParse(feedData)>
<cfdump var="#xmlData#">

enter image description here

please help me with this, already wasted so much time on this please help me and et me know what is my mistake

Community
  • 1
  • 1
Rikhi Sahu
  • 655
  • 1
  • 7
  • 19

1 Answers1

1

Your existing code works fine as-is. You're getting a 404 issue that I'm not getting. The suggestions of the header would be valid if I wasn't using the same header and didn't get a 404. Can you reach that URL in your browser? Maybe the site has blocked you for some reason?

Using James' suggestion of <cffeed> makes it easier. It converts the XML to a struct that is easier to parse.

<cffeed source="https://architechsfortheweb.com/blogfeed/" name="xFeed" />
<cfdump var="#xFeed#">

enter image description here

Adrian J. Moreno
  • 14,350
  • 1
  • 37
  • 44