Saturday, September 10, 2005

RSS, CFHTTP, UTF-8, and CFMX

This interesting problem with CFHTTP and RSS feeds encountered by Roger Benningfield a while back is going to be fixed in the Merrimack updater for ColdFusion 7.

He was having a subtle issue with CFHTTP and RSS feeds, where the XML coming back was being treated as a string sometimes and other times as binary data. CFHTTP examines to content-type to decide how to treat the result. If it's text/*, message/* or application/octet-stream, it is treated like a string. Otherwise it is treat as binary data.

cfhttp has a GetAsBinary attribute, which in CFMX7 can be yes, no, or "auto". In the updater I added a new value, "never", which will always treat the content as text. In addition I added the application/*+xml types as text as well.

I don't like the heard coded list much, but since we have the "never" mode, this puts the control back in the hands of the CFML developer, which is where we want it.

No comments: