title: How do I get rails to parse params from CURL as JSON or XML instead of a string?
body: <p>How do I get rails to parse params as JSON or XML instead of a string?  I'm using rails 3.0.7.</p>
  
  <p>Here's what I want to happen.</p>
  
  <pre><code>Parameters: {"user"=&gt;{"email"=&gt;"user@blah.com", "password"=&gt;"[FILTERED]"}}
  </code></pre>
  
  <p>Here's what happens</p>
  
  <pre><code># controller
  def create
    logger.debug params
  end
  
  # curl from command line
  curl -i -H 'Content-Type:application/xml' -H 'Accept:application/xml' -X POST -d "&lt;user&gt;&lt;email&gt;user@blah.com&lt;/email&gt;&lt;password&gt;password&lt;/password&gt;&lt;/user&gt;" http://localhost:3000/api/v1/sessions.xml
  
  # response
  Started POST "/api/v1/sessions" for 127.0.0.1 at 2011-05-14 02:16:23 -0700
  Processing by Api::V1::SessionsController#create as XML
  Parameters: {"&lt;user&gt;&lt;email&gt;user@blah.com&lt;/email&gt;&lt;password&gt;password&lt;/password&gt;&lt;/user&gt;"}
  {"&lt;user&gt;&lt;email&gt;user@blah.com&lt;/email&gt;&lt;password&gt;password&lt;/password&gt;&lt;/user&gt;", "action"=&gt;"create", "controller"=&gt;"api/v1/sessions", "format"=&gt;"xml"}
  </code></pre>
  
  <p>Same thing happens with JSON.</p>