Help Needed: (PHP) authenticated API requests with github example

Been a while since I have used GuzzleHttp but I think you may want to do something like:

    $result = $response->getBody();
    $object = json_decode($result);

I seem to recall needing to get back the body object then decode that. Keep in mind, been a while, I could be very wrong!

EDIT

I think you are also just building the $request which is to be sent. What you are viewing is the request packet, (by the way - remove that Bearer token from the above screenshot). You need to send the request. Again, I haven’t touched GuzzleHttp in a while, so this could be wrong:

$client = new GuzzleHttp\Client(); 
$response = $client->send($request);  # Send your request that you built.
1 Like