From 8055ea7cd4749c52bd9e31b744c6ffe5d3bed430 Mon Sep 17 00:00:00 2001 From: Matthew Hall Date: Fri, 25 Sep 2020 14:09:55 -0700 Subject: [PATCH 1/2] Update Client.php --- src/Http/Client.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Http/Client.php b/src/Http/Client.php index 2fa4ee4..d085de2 100755 --- a/src/Http/Client.php +++ b/src/Http/Client.php @@ -26,7 +26,7 @@ class Client extends GuzzleClient * * @return mixed|ResponseInterface|string */ - public function request($method, $uri = null, array $options = [], $asJson = true) + public function guzzleRequest($method, $uri = null, array $options = [], $asJson = true) { $response = parent::request($method, $uri, $options); From 4868d1e0f9f823492565b51ffd30e08bdd373a24 Mon Sep 17 00:00:00 2001 From: Matthew Hall Date: Fri, 25 Sep 2020 14:11:18 -0700 Subject: [PATCH 2/2] Update Client.php --- src/Client.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Client.php b/src/Client.php index 242fa09..cad34cd 100755 --- a/src/Client.php +++ b/src/Client.php @@ -212,7 +212,7 @@ public function upload(array $options) $options['FileContentType'] = 'b2/x-auto'; } - $response = $this->client->request('POST', $uploadEndpoint, [ + $response = $this->client->guzzleRequest('POST', $uploadEndpoint, [ 'headers' => [ 'Authorization' => $uploadAuthToken, 'Content-Type' => $options['FileContentType'], @@ -264,7 +264,7 @@ public function download(array $options) $this->authorizeAccount(); - $response = $this->client->request('GET', $requestUrl, $requestOptions, false); + $response = $this->client->guzzleRequest('GET', $requestUrl, $requestOptions, false); return isset($options['SaveAs']) ? true : $response; } @@ -427,7 +427,7 @@ protected function authorizeAccount() return; } - $response = $this->client->request('GET', self::B2_API_BASE_URL.self::B2_API_V1.'/b2_authorize_account', [ + $response = $this->client->guzzleRequest('GET', self::B2_API_BASE_URL.self::B2_API_V1.'/b2_authorize_account', [ 'auth' => [$this->accountId, $this->applicationKey], ]); @@ -614,7 +614,7 @@ protected function uploadParts($filePath, $uploadUrl, $largeFileAuthToken) array_push($sha1_of_parts, sha1($data_part)); fseek($file_handle, $total_bytes_sent); - $response = $this->client->request('POST', $uploadUrl, [ + $response = $this->client->guzzleRequest('POST', $uploadUrl, [ 'headers' => [ 'Authorization' => $largeFileAuthToken, 'Content-Length' => $bytes_sent_for_part, @@ -683,7 +683,7 @@ protected function sendAuthorizedRequest($method, $route, $json = []) { $this->authorizeAccount(); - return $this->client->request($method, $this->apiUrl.$route, [ + return $this->client->guzzleRequest($method, $this->apiUrl.$route, [ 'headers' => [ 'Authorization' => $this->authToken, ],