title: HTTP POST rails 3 - json - 406 & 500 error
body: <p>I am having trouble sending data through HTTP REST. When I try and POST json data through the chrome extension 'Simple REST Client' I get a 500 internal server error stating "The document does not have a valid root". When I curl I get a 406 error. But when I leave the data filed empty in both the client and curl a blank document is created! I have changed the json text to every possible valid combination and putting the data back in that the GET produces but no luck!</p>
  
  <p>My controller code is:</p>
  
  <pre><code>def create
  @verify = Verify.new(params[:verify])
  
  respond_to do |format|
    if @verify.save
      format.html { redirect_to( :back, :notice =&gt; 'Verified') }
      format.json { render :json =&gt; @verify, :status =&gt; :created, :location =&gt; @verify }
    else
      format.html { render :action =&gt; "new" }
      format.xml  { render :xml =&gt; @verify.errors, :status =&gt; :unprocessable_entity }
      format.json  { render :json =&gt; @verify.errors, :status =&gt; :unprocessable_entity }
    end
  end
  </code></pre>
  
  <p>end</p>
  
  <p>Sample json</p>
  
  <pre><code>{"www" : "wwww"}
  </code></pre>
  
  <p>I'm using Mongoid and Devise gems (tried removing before_filter from controller but that made no difference).</p>