Connection Failure with Yahoo Web Services and ColdFusion
If you tried using the Yahoo Web Services with CFHTTP and your cfhttp.filecontent variable had the value: Connection Failure, or if you had throwonerror="true" and you got the error: Connection Failure: Status code unavailable it is due to an encoding issue. You need to set charset="utf-8" in your CFHTTP call.
Yahoo point's out in their FAQ item: Why does ColdFusion keep giving me a "Connection Failure" message?
It's an encoding issue. You need to add <cfhttpparam type="Header" name="charset" value="utf-8" /> to your cfhttp call and it should work.
This didn't work for me when I tried it, only setting the charset attribute in CFHTTP did the trick for me. What I suspect is that in ColdFusion MX 7 setting the header with CFHTTPPARAM works, but does not in 6.1
Tweet
Trackbacks
Comments
awesome site and a great CF resource, and it's quickly become a daily for me :)
Thanks for this post, it helped save the day!
Tony
can someone pls explain why this code throws an exception as stated above. The other thing I have in url is https, is there special settings need to be done on server so that this exception can be stopped. Thanks in advance for your help.
<cfhttp url="http://mail.yahoo.com/" method="get" redirect="Yes" resolveurl="Yes"> <cfhttpparam type="Header" name="charset" value="utf-8" /> </cfhttp> <cfoutput> <cffile action="WRITE" file="c:\inetpub\wwwroot\new.html" output="#cfhttp.FileContent#" addnewline="Yes" nameconflict="OVERWRITE"> <cflocation url="new.html" addtoken="No"> </cfoutput>
Post a Comment
Recent Entries
- Nginx redirect www to non www domain
- HashDOS and ColdFusion
- HackMyCF Updated for APSB11-29 Security Hotfix
- Adobe eSeminar on FuseGuard
- Determining Which Cumulative Hotfixes are Installed on ColdFusion
- Adding Two Factor Authentication to ColdFusion Administrator
- ColdFusion Developer Week at Adobe.com
- Bug Loading Scripts for CFFileUpload and CFMediaPlayer


add to del.icio.us



