Using POST For ColdFusion Ajax Calls

A ColdFusion user asked me (at MAX) how to get ColdFusion’s Ajax calls to use POST instead of the default GET. The answer, courtesy of ColdFusion team member Rakshith, is to use to define the proxy CFC, and then use the setHTTPMethod() method to set the method type. Here is Rakshith’s example:

5 responses to “Using POST For ColdFusion Ajax Calls”

  1. Raymond Camden Avatar
    Raymond Camden

    Don’t forget about ColdFusion.Ajax.submitForm().

  2. phill.nacelli Avatar

    This comes really handy with large amount of text being posted .. last month I learned about the setHTTPMethod() the hard way since I had a page that posted a large amount of text and I kept getting an error in IE (suprised?) but it was working in Firefox. So if you are getting an error when using IE, check that you are setting the http method to "POST".
    thanks for posting this Ben…

  3. todd sharp Avatar
    todd sharp

    ColdFusion.navigate also lets you set the http method:
    ColdFusion.navigate(URL [, container, callbackhandler, errorhandler, httpMethod, formId])

  4. Jim W. Avatar
    Jim W.

    Great. This is exactly what I needed. I was posting too much data for GET. Thank you!

  5. Alan M Avatar
    Alan M

    Thank you! Exactly what I needed – over five years after you posted it :).

Leave a Reply