3v4l.org

run code in 300+ PHP versions simultaneously
<?php $params = array( 'client_id' => 'apiClientId', 'client_secret' => 'apiClientSecret', 'grant_type' => 'password', 'username' => 'apiUsername', 'password' => 'apiPassword', ); $request = array( 'http' => array( 'method' => 'POST', 'header' => array( 'Content-type: application/x-www-form-urlencoded', ), 'content' => http_build_query($params), 'timeout' => 10, ) ); if (!$response = file_get_contents('https://moj.minimax.si/demo/si/aut/oauth20/token', false, stream_context_create($request))) { die('auth error'); } $token = json_decode($response);

preferences:
45.05 ms | 402 KiB | 5 Q