Shaun Mccran

My digital playground

17
F
E
B
2009

CfHttp compression responses when calling a url - 360 Voice part 1

I was recently writing a service to consume an xml feed, and I stumbled upon an issue that I had previously not seen with the cfhttp tag. These days I would usually opt for a cfc call to a webservice, and consume it as a 'true' service object, but this is an old school http request, as I am reading asp page content. I setup the standard cfhttp code in coldfusion.

view plain print about
1<cfhttp url="http://www.360voice.com/api/blog-getentries.asp?tag=ect0z" method="GET">

Unfortunately the http response was "Connection Failure". After investigating various potential authentication issues from both the destination server and the source server I had hit a wall. I fired up 'HTTP debugger' and had a scan of the http responses to see if anything stood out, and discovered that the http response was actually '200' which signifies everything is ok. So I was actually receiving a valid response. Maybe the problem was coldfusion. It transpires that if CF receives compressed or encrypted http responses you have to tell it what to do with them manually.

view plain print about
1<cfhttpparam type="Header" name="Accept-Encoding" value="deflate;q=0">
2<cfhttpparam type="Header" name="TE" value="deflate;q=0">

By adding these headers to the cfhttp you are requesting that the server return uncompressed responses, allowing coldfusion to handle the data returned. I ended out piecing this together from several different sources, but this site (http://www.talkingtree.com/blog/index.cfm/2004/7/28/20040729) has a very good blog entry on this as well. So thanks Steven Erat, you helped a ton there!

Complete code:

view plain print about
1<cfhttp url="http://www.yourUrl.com" method="GET" charset="utf-8">
2<cfhttpparam type="Header" name="Accept-Encoding" value="deflate;q=0">
3<cfhttpparam type="Header" name="TE" value="deflate;q=0">
4</cfhttp>

Now on to why I was actually writing this cfhttp request in the first place, http://www.360voice.com/, where you can hook up your XBox 360 to a web data feed.

Like this.

13
F
E
B
2009

Tomb raider for a tonne?

I noticed this the other day on ebay, seems a bit ambitious if you ask me!

I suppose there is no harm in trying! Althought its only £20.00 on the highstreet......

17
N
O
V
2008

Xbox 360 to get a new controller (Gross green!)

So I was sent a link to the new XBOX 360 controller this morning. Its supposed to have a more sensitive D pad, but that doesn't excuse it from being the most god awful green colour.

Check out a full article at Gizmodo:

http://uk.gizmodo.com/2008/08/21/xbox_360_getting_new_controlle.html

_UNKNOWNTRANSLATION_