Skip to content

Commit

Permalink
Merge pull request #54 from springboardVR/master
Browse files Browse the repository at this point in the history
Guzzle 7 Interface Fix
  • Loading branch information
mhetreramesh committed Sep 26, 2020
2 parents ecb9c70 + 4868d1e commit c6aa7b9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/Client.php
Expand Up @@ -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'],
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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],
]);

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
],
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Client.php
Expand Up @@ -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);

Expand Down

0 comments on commit c6aa7b9

Please sign in to comment.