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.
route/api.php
Route::get('auth', 'UntisController@auth');
UntisController.php
class UntisController extends Controller
{
public function auth()
{
$client = new \GuzzleHttp\Client();
$req = $client->post( 'https://asopo.webuntis.com/WebUntis/jsonrpc.do?school=htblva_villach',[
"id" => 8294829,
"method" => "authenticate",
"params" => [
"user" => "USERNAME",
"password" => "PASSWORD",
"client" => "web"
],
"jsonrpc" => "2.0"
],
['Content-Type' => 'application/json'
]);
dd($req);
}
}
the response I get with POSTMAN, the respones i want
The response I get from my code
I have tried it already with
dd($req->getBody());
but I do not get the sessionid i want.