Hi James, If you modify your curl command line to fully use the XML API , it will work. Based on your example, it would be:
$curl -u username:password -H "Content-Type: text/xml" -d "<todo><description>Test out this new installation</description><context_id>8</context_id></todo" http://example.com:8000/todos.xml -i The reason this works where the other fails is that Rails bypasses CSRF protection for requests that come in with a Content-Type header of XML. Hope that helps. Cheers, Luke On Jun 18, 2008, at 9:58 AM, James Carruth wrote: > I have a very simple email to next action script that creates next > actions in Tracks using curl. It stopped working after I moved to the > newest version from github (I had previously been using the svn trunk > version). Tracks works fine from the web, but I get an error when I > try to add new next actions following the instructions on the > Integrations page. > > Here is what I type at the command prompt (relevant details have been > changed to protect the innocent) > > $curl -u username:password -d "todo[description]=Test out this new > installation&todo[context_id]=8" http://example.com:8000/todos.xml -i > > Here is the response I get back: > > HTTP/1.1 422 > Connection: close > Date: Wed, 18 Jun 2008 13:45:02 GMT > Set-Cookie: _session_id=b49573b5521b44789e880b3d925f66bf; path=/ > Status: 422 Unprocessable Entity > Cache-Control: no-cache > Server: Mongrel 1.1.3 > Content-Type: text/html; charset=utf-8 > Content-Length: 1 > > I would appreciate any help I can get. Do I have a typo that I am > just missing or is something actually not working? Thanks > > > James Carruth > http://www.thecarruths.org > http://www.edehaiti.org > _______________________________________________ > Tracks-discuss mailing list > [email protected] > http://lists.rousette.org.uk/mailman/listinfo/tracks-discuss -- Luke Melia [EMAIL PROTECTED] http://www.lukemelia.com/ _______________________________________________ Tracks-discuss mailing list [email protected] http://lists.rousette.org.uk/mailman/listinfo/tracks-discuss
