Now that JavaLoader exists, integrating Java with ColdFusion becomes so ridiculously easy, it would have been relative heresy if I hadn't sat down for an afternoon and wrote a library for making asynchronous HTTP GET and POST requests.
To use the asyncHTTP library , you simply have to drop /asyncHTTP/ the folder in your web root, or create a mapping to it.
From here we create an instance of the AsyncHTTP.cfc:
asyncHTTP = createObject("component", "asyncHTTP.AsyncHTTP").init();
Now that we have an instance of the AsynHTTP CFC, to do an asynchronous GET request, we simply call:
If we want to pass form data across, we can also do an asynchronous POST request, like so:
formData = StructNew();
formData.var = "value";
That is it! It is as simple as that.
Please download the library, give is a spin, and any questions, feedback, bugs or general comments, please either reply to this blog post, or shoot me an email .