Skip to content

Commit

Permalink
Merge pull request #57 from picqer/get-header-info-from-endpoint
Browse files Browse the repository at this point in the history
Voeg de mogelijkheid toe om (alleen) de headers van een response te verkrijgen.
  • Loading branch information
sanderlissenburg authored Jan 27, 2025
2 parents 3e34d55 + 0e8b171 commit 6892309
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/BaseClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ class BaseClient
/** @var ?callable */
private $accessTokenExpiredCallback = null;

private $lastResponseHeaders = null;

/**
* BaseClient constructor.
*/
Expand Down Expand Up @@ -375,9 +377,19 @@ public function request(string $method, string $url, array $options, array $resp
}
}

$this->lastResponseHeaders = $response->getHeaders();

return $this->decodeResponse($response, $responseTypes, $url);
}

/**
* @return array|null
*/
public function getLastResponseHeaders(): ?array
{
return $this->lastResponseHeaders;
}

/**
* Validates the existence of the token and its expiration. If the token is expired, the accessTokenExpiredCallback is
* called.
Expand Down

0 comments on commit 6892309

Please sign in to comment.