public function request(string $method, string $path, array $parameters = [])
    {
        $options = [
            'headers' => [
                'Authorization' => sprintf('Key %s', $this->apiKey),
                'User-Agent' => sprintf(
                  'Clarifai PHP (https://github.com/darrynten/clarifai-php);v%s;%s',
                  \DarrynTen\Clarifai\Clarifai::VERSION,
                  phpversion()
                ),
            ],
        ];

        // TODO check for batch operation
        return $this->handleRequest(
            $method,
            sprintf('%s/%s/%s', $this->url, $this->version, $path),
            $options,
            $parameters
        );
    }
public function request(string $method, string $path, array $parameters = [])
    {
        $options = [
            'headers' => [
                'Authorization' => sprintf('Key %s', $this->apiKey),
                'User-Agent' => sprintf(
                  'Clarifai PHP (https://github.com/darrynten/clarifai-php);v%s;%s',
                  \DarrynTen\Clarifai\Clarifai::VERSION,
                  phpversion()
                ),
            ],
        ];

        // TODO check for batch operation
        return $this->handleRequest(
            $method,
            sprintf('%s/%s/%s', $this->url, $this->version, $path),
            $options,
            $parameters
        );
    }
public function request ( string $ method , string $ path , array $ parameters = [ ] ) { $ options = [ 'headers' => [ 'Authorization' => sprintf ( 'Key %s' , $ this -> apiKey ) , 'User-Agent' => sprintf ( 'Clarifai PHP (https://github.com/darrynten/clarifai-php);v%s;%s' , \ DarrynTen \ Clarifai \ Clarifai :: VERSION , phpversion ( ) ) , ] , ] ; // TODO check for batch operation return $ this -> handleRequest ( $ method , sprintf ( '%s/%s/%s' , $ this -> url , $ this -> version , $ path ) , $ options , $ parameters ) ; }
Makes a request to Clarifai

@param string $method The API method
@param string $path The path
@param array $parameters The request parameters

@return array

@throws ApiException
Makes a request to Clarifai