From c68773f67e0718ce9346d20892c75dd49c0603b8 Mon Sep 17 00:00:00 2001 From: Mehmet Uygun Date: Thu, 26 Jan 2023 21:50:51 +0000 Subject: [PATCH] Add headers to response In order to check the following attributes X-Limit-Per-Second, X-Remaining-This-Second, X-Limit-Per-Day, X-Remaining-Today, we need to be able to get headers. --- src/OAuth/Client.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/OAuth/Client.php b/src/OAuth/Client.php index a6cd261..dd0d9b1 100644 --- a/src/OAuth/Client.php +++ b/src/OAuth/Client.php @@ -113,9 +113,11 @@ public function __call($method, $args) { try { $client = $this->createHttpClient(); $response = $client->{$method}(self::API_URL.$uri, $opts); + $headers = $response->getHeaders(); $response = json_decode($response->getBody(), false); if($response) { $response->uri = $uri; + $response->headers = $headers; } return $response; }