I have a problem with the following:
- I am creating an API (I'm new with this)
- With this API I want to consume another API or WebService
- In Postman I make a get request to the URL and it returns OK the access_token, but in the Laravel project it returns:
"error" => "unsupported_grant_type".
This is my code:
use Illuminate\Support\Facades\Http;
$response = Http::withHeaders([
'content-type' => 'application/x-www-form-urlencoded'
])->post('http://url:52904/Token', [
'userName' => 'menganito',
'password' => 'pepito',
'grant_type' => 'password'
]);
dd($response->json());
I tried installing ** Laravel Passport **, but I'm not using a DB for now.