title: How to get Json input in CakePhp Restful API using PUT
body: <p>I am able to <code>view</code> and <code>delete</code> the data by passing ID in the URl in format of:</p>
  
  <pre><code>/apis/view/id.json
  </code></pre>
  
  <p>using: </p>
  
  <pre><code>public function view($id) {
          $api = $this-&gt;Api-&gt;findById($id);
          $this-&gt;set(array(
              'api' =&gt; $api,
              '_serialize' =&gt; array('api')
          ));
      }
  </code></pre>
  
  <p>Similarly I want to implement <code>add</code> and <code>edit</code>, where I can pass data in Json format in the HTTP body and store/edit it in the database. </p>
  
  <p>I couldn't follow the this solution:
  <a href="https://stackoverflow.com/questions/8605975/cakephp-api-put-with-json-input">CakePHP API PUT with JSON input</a></p>
  
  <p>I couldn't understand how to use </p>
  
  <pre><code>$data = $this-&gt;request-&gt;input('json_decode');
  </code></pre>
  
  <p>to achieve it.</p>