How to receive POST data in controller.
Erik Terpstra
erik at ruby-lang.nl
Tue Jul 31 09:18:14 EDT 2007
Hi,
When I create a controller like this:
module Bla::Controllers
class Workflow < R '/workflow/([^\/]+)'
def post(name)
@@log.info input.inspect
end
end
end
And POST some data from the command line:
curl -i -X POST -H 'Content-Type: application/xml' -d '<doc><test attr="423"/></doc>' 'http://localhost/workflow/test'
I see this in my log:
{"<doc><test attr"=>"\"423\"/></doc>"}
It seems that it builds a hash from my POSTED data.
How can I get the data as it was submitted?
TIA,
Erik.
More information about the Camping-list
mailing list