title: Laravel: return post request body from Postman in json
body: <p>I am trying to make a test work. I use a REST client, "Postman" to send a POST request with an object to Laravel. The idea is to get back the request as an object. But I don't think I am getting the right result.</p>
  
  <p>In Postman, I specify the adress to send to, choose "POST", and then send this:</p>
  
  <pre><code>{
     "url": "http://testingtesting.com"
  }
  </code></pre>
  
  <p>In Laravel I have a Route to the adress:</p>
  
  <pre><code>Route::post('api/test', 'TestController@index');
  </code></pre>
  
  <p>and the controller should return the json object. If I do this:</p>
  
  <pre><code>    class TestController extends BaseController{
         public function index(){
             $input = Input::json()-&gt;all();
             var_dump($input);
             }
      }
  </code></pre>
  
  <p>I get back an array in POSTman:</p>
  
  <pre><code>array (size=1)
    'url' =&gt; string 'http://testingtesting.com' (length=18)
  </code></pre>
  
  <p>That's when I look at "preview". If I switch to "Pretty" it shows like this:</p>
  
  <pre><code>&lt;pre class='xdebug-var-dump' dir='ltr'&gt;
      &lt;b&gt;array&lt;/b&gt;
      &lt;i&gt;(size=1)&lt;/i&gt;
    'url' 
      &lt;font color='#888a85'&gt;=&amp;gt;&lt;/font&gt;
      &lt;small&gt;string&lt;/small&gt;
      &lt;font color='#cc0000'&gt;'http://testing.com'&lt;/font&gt;
      &lt;i&gt;(length=18)&lt;/i&gt;
  &lt;/pre&gt;
  </code></pre>
  
  <p>but I'm supposed to get an <strong>object(stdClass)</strong>, not an array. What do I need to do?</p>