title: Laravel POST request to API answer
body: <p>I have got a Laravel Application which should send a POST request with parameters to the WebUntis API and the response should be a session id. I can send a POST request and I get a answer but I do not get the session key. I have tested the code in Postman and there it works.</p>
  
  <p><strong>route/api.php</strong></p>
  
  <pre><code>Route::get('auth', 'UntisController@auth');
  </code></pre>
  
  <p><strong>UntisController.php</strong></p>
  
  <pre><code>class UntisController extends Controller
  {
  
    public function auth()
    {
  
      $client = new \GuzzleHttp\Client();
      $req = $client-&gt;post( 'https://asopo.webuntis.com/WebUntis/jsonrpc.do?school=htblva_villach',[
  
                  "id" =&gt; 8294829,
                  "method" =&gt; "authenticate",
                  "params" =&gt; [
                      "user" =&gt; "USERNAME",
                      "password" =&gt; "PASSWORD",
                      "client" =&gt; "web"
                  ],
                  "jsonrpc" =&gt; "2.0"
      ],
      ['Content-Type' =&gt; 'application/json'
      ]);
  
  
  
      dd($req);
    }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/q4z3X.png" rel="nofollow noreferrer">the response I get with POSTMAN, the respones i want</a></p>
  
  <p><a href="https://i.stack.imgur.com/NxdWM.png" rel="nofollow noreferrer">my Postman request</a></p>
  
  <p><a href="https://i.stack.imgur.com/nbP57.png" rel="nofollow noreferrer">The response I get from my code</a></p>
  
  <p>I have tried it already with </p>
  
  <pre><code>   dd($req-&gt;getBody());
  </code></pre>
  
  <p>but I do not get the sessionid i want.</p>