title: How to send JSON form data with Mechanize or Faraday in Ruby
body: <p>I want to retrieve data from a website that uses JSON data to set custom search parameters which seem to be requested via AJAX. The data transmitted shows up under XHR->Request Payload in Firebug:</p>
  
  <pre><code>{"filters": [{"action": "post", "filterName": "Hersteller", "ids": [269], 
  "settingName": "Hersteller", "settingValue": "ValueA"}, 
  {"action": "delete", "filterName": "Modelle", 
  "settingName": "Modelle", "settingValue": ""}]}
  </code></pre>
  
  <p>The site doesn't transmit any POST parameters but only this JSON encoded data to apply search criteria. Passing this data as post parameters with Mechanize doesn't work.</p>
  
  <p>How can this data be transmitted using Mechanize or Faraday in Ruby on Rails?</p>