Here’s a method to get an JSON feed with ColdFusion. This will work in ColdFusion 7 and later.
This is useful for avoiding cross-site scripting in Javascript/jQuery – You would simply call your remote feed on your local server, and then your jQuery would be able to call a “local” resource.
Code walkthrough:
- Use CFHTTP to generate an HTTP request and handle the response from the server. This should return JSON.
- Set the appropriate MIME content type.
- Return the resulting JSON string.
This example should be enhanced with try/catch error handling
