⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.180
Server IP:
13.127.59.50
Server:
Linux ip-172-31-46-210 5.15.0-1033-aws #37~20.04.1-Ubuntu SMP Fri Mar 17 11:39:30 UTC 2023 x86_64
Server Software:
Apache/2.4.41 (Ubuntu)
PHP Version:
7.4.3-4ubuntu2.29
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
ubuntu
/
vendor
/
twilio
/
sdk
/
src
/
Twilio
/
Http
/
View File Name :
GuzzleClient.php
<?php namespace Twilio\Http; use GuzzleHttp\ClientInterface; use GuzzleHttp\Exception\BadResponseException; use GuzzleHttp\Psr7\Query; use GuzzleHttp\Psr7\Request; use Twilio\Exceptions\HttpException; final class GuzzleClient implements Client { /** * @var ClientInterface */ private $client; public function __construct(ClientInterface $client) { $this->client = $client; } public function request(string $method, string $url, array $params = [], array $data = [], array $headers = [], string $user = null, string $password = null, int $timeout = null): Response { try { $body = Query::build($data, PHP_QUERY_RFC1738); $options = [ 'timeout' => $timeout, 'auth' => [$user, $password], 'body' => $body, ]; if ($params) { $options['query'] = $params; } $response = $this->client->send(new Request($method, $url, $headers), $options); } catch (BadResponseException $exception) { $response = $exception->getResponse(); } catch (\Exception $exception) { throw new HttpException('Unable to complete the HTTP request', 0, $exception); } // Casting the body (stream) to a string performs a rewind, ensuring we return the entire response. // See https://stackoverflow.com/a/30549372/86696 return new Response($response->getStatusCode(), (string)$response->getBody(), $response->getHeaders()); } }