Issue cfloop with a collection in a cfhttp tag

After nearly 4 years of using ColdFusion 9 and ColdFusion 10, I have had to revert to using ColdFusion 8 for a project recently.

To do a http post these days I would normally be able to use http() and just a few lines of code to setup the formfields. Using and felt pretty archaic. It always did. But such is life.

Trying to keep it dynamic, I wanted to loop through a structure which could have variable formfields based on the payment type. The most obvious way to do this failed miserably.

I could not figure it out for a few seconds as it did not throw, but none of the formfields passed this way were actually sent.

The response from the web service claimed it was missing the fields.

Putting this same logic outside the worked fine, but for whatever reason did not create formfield params inside. Fine!

The next best thing I could find and keeping it dynamic was this:

So if you ever find yourself in this hard spot, this might get you through the straits without pulling all your hair out.

CachedSince:{ts '2024-06-12 18:57:35'}