I am creating a RESTful web service and want to allow the user to
supply the POST/PUT representation as either url-encoded key/value
pairs or XML. I have read in several sources that Rails will parse
incoming XML into the params hash. The following data should be
equivalent:
XML: <product><test>Hello</test></product>
url-encoded: product[test]=Hello
They should both result in the hash params = {"product" =>
{"test" =>
"Hello"}} (+ format, controller and action keys)
But when I do the following curl command:
> curl -u name:pass -i -X POST -d
"<product><test>Hej</test></product>"
http://localhost:3003/product.xml
the params hash looks like this:
{"<dt_order><test>Hej</test></dt_order>"=>""}
Does anyone have any input on why this happens and how to solve it. I
am running 1.2.6 and a 2.0 migration is not possible since the
application is in production.
Thanks in advance
Erik Lindblad
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---