Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/Vimeo/Vimeo.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,11 @@ public function __construct(string $client_id, string $client_secret, string $ac
* @param string $method The HTTP Method of the request
* @param bool $json_body
* @param array $headers An array of HTTP headers to pass along with the request.
* @param bool $absoluteUrl
* @return array This array contains three keys, 'status' is the status code, 'body' is an object representation of the json response body, and headers are an associated array of response headers
* @throws VimeoRequestException
*/
public function request($url, $params = array(), $method = 'GET', $json_body = true, array $headers = array()): array
public function request($url, $params = array(), $method = 'GET', $json_body = true, array $headers = array(), bool $absoluteUrl = false): array
{
$headers = array_merge(array(
'Accept' => self::VERSION_STRING,
Expand Down Expand Up @@ -120,7 +121,10 @@ public function request($url, $params = array(), $method = 'GET', $json_body = t
$query_component = '';
}

$curl_url = self::ROOT_ENDPOINT . $url . $query_component;
$curl_url = (!$absoluteUrl ? self::ROOT_ENDPOINT : '') . $url . $query_component;
$curl_opts = array(
CURLOPT_CUSTOMREQUEST => $method,
);
break;

case 'POST':
Expand All @@ -134,7 +138,7 @@ public function request($url, $params = array(), $method = 'GET', $json_body = t
$body = http_build_query($params, '', '&');
}

$curl_url = self::ROOT_ENDPOINT . $url;
$curl_url = (!$absoluteUrl ? self::ROOT_ENDPOINT : '') . $url;
$curl_opts = array(
CURLOPT_POST => true,
CURLOPT_CUSTOMREQUEST => $method,
Expand Down Expand Up @@ -579,7 +583,7 @@ private function _authHeader(): string
* @return string
* @throws VimeoUploadException
*/
private function perform_upload_tus(string $file_path, $file_size, array $attempt): string
public function perform_upload_tus(string $file_path, $file_size, array $attempt): string
{
$default_chunk_size = (100 * 1024 * 1024); // 100 MB

Expand Down