ajax

Using MochiKit doXHR with POST

This is a followup to my old post Using MochiKit doXHR using POST instead of GET.

The data that you send back in your controller will be stored in the Deferred object that gets returned. Look in the responseText field of the object.


var d = doXHR(url, 
   { method:'POST', 
     sendContent:qry, 
headers:{"Content-Type":"application/x-www-form-urlencoded"}
   });

The headers piece was the critical for the POST to work on my configuration.