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

theideabulb
theideabulb used Ask the Experts™
on
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?

Image of xml feed

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
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2015

Commented:
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")>
This here was the answer..
http://stackoverflow.com/questions/2974197/cfhttp-encoding-problem

Looks like it was being gzipped twice.  Once I followed these instructions, it works fine.
Most Valuable Expert 2015

Commented:
Oh, without the cfhttp headers I didn't realize it was gzipped, not just binary. Glad you solved it!

Author

Commented:
I found the answer that worked for my issue.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial