Level 2
And after send request by guzzle, I can't take any response from server.. It ruins all responses..
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi everyone. For two days, I have been tyring to take oauth token by makin guzzlehttp request. But guzzle request doesn't response. It waits for response then exceeds execution time. I installed guzzlehttp, enabled allow_url_fopen and curl in php.ini file. What can be the problem with guzzel. I'm trying to take token by using postman and here is my controller
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use GuzzleHttp;
class AuthController extends Controller {
public function login (Request $request) {
$http = new GuzzleHttp\Client;
$response = $http->request('post', 'http://127.0.0.1:8000/oauth/token', [
'form_params' => [
'grant_type' => 'password',
'client_id' => 2,
'client_secret' => 'XAjhpNmcpcAA7DnboSQp7GEiE0vFk4E4qPGt5eDr',
'username' => $request->username,
'password' => $request->password,
'scope' => '',
],
]);
return json_decode((string) $response->getBody(), true);
}
}
Please or to participate in this conversation.