getContent(); } /** * Makes a request to the URL by using the preferred method * * @param string $method method to call such as GET, PUT, etc * @param string $uri URL to call * @param array $overrides An array of parameters for both `curl` and `fopen` * @param callable|null $callback Either a function or callback in array notation * @return ResponseInterface * @throws TransportExceptionInterface */ public static function request(string $method, string $uri, array $overrides = [], callable $callback = null): ResponseInterface { if (empty($method)) { throw new TransportException('missing method (GET, PUT, etc.)'); } if (empty($uri)) { throw new TransportException('missing URI'); } // check if this function is available, if so use it to stop any timeouts try { if (Utils::functionExists('set_time_limit')) { @set_time_limit(0); } } catch (Exception $e) {} $client = Client::getClient($overrides, 6, $callback); return $client->request($method, $uri); } /** * Is this a remote file or not * * @param string $file * @return bool */ public static function isRemote($file): bool { return (bool) filter_var($file, FILTER_VALIDATE_URL); } }