I make an API and now I try to access to that API. WIth Postman everything is perfect and works fine:
but when I try the same with guzzle/laravel with code:
$res3 = $client3->post('https://app.EXAMPLE.com/api/update/'.$serial, [
'headers' => [
'Authorization' => 'Bearer '.$res2['token'],
'Content-Type' => 'application/json'
],
'form_params' => [
'token' => $res2['token'],
'bookingdate' => '07/07/2018 12:00 am',
'notes' => $SpecialRequests
]
]);
I got:
Object
data : debug : class : "Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException" file : "/home/user_name/public_html/vendor/dingo/api/src/Auth/Auth.php" line : 113
What is a problem? WHy works in Postman but won't work with Laravel/Guzzle library?