title: Returning post data as JSON
body: <p>consider the function </p>
  
  <pre><code>public JsonResult poststuff()
      {
          var form = Request.Form;
          return new JsonResult() { Data = form };
      }
  </code></pre>
  
  <p>consider the submitted data (JSON)</p>
  
  <pre><code>    {
          name: "John Doe",
          age: "50"
      }
  </code></pre>
  
  <p><strong>This is my question</strong></p>
  
  <p>Is there any way to return the post data as a JSON? Without having to pull the data apart and insert it into an object of an type?</p>
  
  <p>I feel like i've been trawling the web for an answer but has not been able to find one ... and know i turn to you. </p>
  
  <p><strong>The returndata would be prefered as the following:</strong></p>
  
  <p>{
      data: {
          name: "John Doe",
          age: 50
      }
  }
  <strong>or even better</strong> {
      name: "John Doe",
      age: 50
  }</p>
  
  <p>Is it even possible to do it in a simple way? I know it is i PHP but i've never succeeded in finding an answer in C# .NET</p>
  
  <p>As a reference, the wished result can be created in PHP as easy as </p>
  
  <pre><code>$input_data = json_decode(trim(file_get_contents('php://input')), true);
  echo json_encode($input_data);
  </code></pre>