����JFIF��x�x����'
| Server IP : 78.140.185.180 / Your IP : 216.73.216.169 Web Server : LiteSpeed System : Linux cpanel13.v.fozzy.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64 User : builderbox ( 1072) PHP Version : 7.3.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/thread-self/root/home/builderbox/././www/vendor/gliterd/backblaze-b2/src/Http/ |
Upload File : |
<?php
namespace BackblazeB2\Http;
use BackblazeB2\ErrorHandler;
use BackblazeB2\Exceptions\B2Exception;
use GuzzleHttp\Client as GuzzleClient;
use GuzzleHttp\Exception\GuzzleException;
use Psr\Http\Message\ResponseInterface;
/**
* Client wrapper around Guzzle.
*/
class Client extends GuzzleClient
{
/**
* Sends a response to the B2 API, automatically handling decoding JSON and errors.
*
* @param string $method
* @param null $uri
* @param array $options
* @param bool $asJson
*
* @throws GuzzleException If the request fails.
* @throws B2Exception If the B2 server replies with an error.
*
* @return mixed|ResponseInterface|string
*/
public function guzzleRequest($method, $uri = null, array $options = [], $asJson = true)
{
$response = parent::request($method, $uri, $options);
if ($response->getStatusCode() !== 200) {
ErrorHandler::handleErrorResponse($response);
}
if ($asJson) {
return json_decode($response->getBody(), true);
}
return $response->getBody()->getContents();
}
}