public function getApiUrl($path = '/', array $query = [])
    {
        $base = new Uri($this->apiUrl);
        $path = new Uri($path);

        foreach ($query as $key => $value) {
            $path = Uri::withQueryValue($path, $key, $value);
        }

        return (string) UriResolver::resolve($base, $path);
    }
public function getApiUrl($path = '/', array $query = [])
    {
        $base = new Uri($this->apiUrl);
        $path = new Uri($path);

        foreach ($query as $key => $value) {
            $path = Uri::withQueryValue($path, $key, $value);
        }

        return (string) UriResolver::resolve($base, $path);
    }
public function getApiUrl ( $ path = '/' , array $ query = [ ] ) { $ base = new Uri ( $ this -> apiUrl ) ; $ path = new Uri ( $ path ) ; foreach ( $ query as $ key => $ value ) { $ path = Uri :: withQueryValue ( $ path , $ key , $ value ) ; } return ( string ) UriResolver :: resolve ( $ base , $ path ) ; }
Build and returns the URL for API requests.

@param string $path
@param array $query
@return string
Build and returns the URL for API requests .