Solved

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

Posted on 2014-02-26
4
189 Views
Last Modified: 2014-03-05
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
0
Comment
Question by:theideabulb
  • 2
  • 2
4 Comments
 
LVL 52

Expert Comment

by:_agx_
Comment Utility
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")>
0
 

Accepted Solution

by:
theideabulb earned 0 total points
Comment Utility
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.
0
 
LVL 52

Expert Comment

by:_agx_
Comment Utility
Oh, without the cfhttp headers I didn't realize it was gzipped, not just binary. Glad you solved it!
0
 

Author Closing Comment

by:theideabulb
Comment Utility
I found the answer that worked for my issue.
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

This article  is about submitting  form through  ColdFusion.Ajax.submitForm to the action page and send a response back in JSON format which later can be decoded using ColdFusion.JSON.decode. By this way you can avoid the usual page refresh for subm…
Hi. There are several upload tutorials using jquery and coldfusion. I found a very interesting one here Upload Your Files using Jquery & ColdFusion and Preview them (http://www.randhawaworld.com/) . I did keep the main js functions but made sever…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now