Link to home
Start Free TrialLog in
Avatar of theideabulb
theideabulbFlag for United States of America

asked on

Why is my cfhttp get for xml file creating strange encryption like characters?

The XML feed looks great, but when I do a simple http call to get the data, it is "encrypting" it or doing something odd.  Anyone know what causes this and what to do to fix it?

User generated image

This here is what I am doing:

<cfset feedURL="http://api.walmartlabs.com/v1/feeds/items?apiKey=xxx&categoryId=xxx&format=xml">
<cfhttp method="get" url="#feedURL#" result="feedItems"></cfhttp>
<cfdump var="#feedItems#">

Open in new window


I am using CF10
Avatar of _agx_
_agx_
Flag of United States of America image

Looks like it might just be binary.  What are the rest of the http headers from the dump? Also, what does their API say about format? (Is there a public link?)

In the mean time, if you have confirmed it's binary ie IsBinary(), try converting it to a string:

         <cfset feedAsString = charsetEncode(feedItems, "UTF-8")>
ASKER CERTIFIED SOLUTION
Avatar of theideabulb
theideabulb
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Oh, without the cfhttp headers I didn't realize it was gzipped, not just binary. Glad you solved it!
Avatar of theideabulb

ASKER

I found the answer that worked for my issue.