public function callService($serviceName, $action, array $parameters = array(), array $files = array())
    {
        $httpClient = $this->getHTTPClient();

        $url = $this->getServiceUrl($serviceName, $action);
        $request = new Request('POST', $url, $this->getRequestHeaders($url, $parameters), $this->getRequestBody($parameters, $files));

        try {
            $response = $httpClient->send($request);
        } catch (GuzzleRequestException $exception) {
            $response = $exception->getResponse();
        }

        $this->validateAPIResponseCode($request, $response);

        return $response;
    }
public function callService($serviceName, $action, array $parameters = array(), array $files = array())
    {
        $httpClient = $this->getHTTPClient();

        $url = $this->getServiceUrl($serviceName, $action);
        $request = new Request('POST', $url, $this->getRequestHeaders($url, $parameters), $this->getRequestBody($parameters, $files));

        try {
            $response = $httpClient->send($request);
        } catch (GuzzleRequestException $exception) {
            $response = $exception->getResponse();
        }

        $this->validateAPIResponseCode($request, $response);

        return $response;
    }
public function callService ( $ serviceName , $ action , array $ parameters = array ( ) , array $ files = array ( ) ) { $ httpClient = $ this -> getHTTPClient ( ) ; $ url = $ this -> getServiceUrl ( $ serviceName , $ action ) ; $ request = new Request ( 'POST' , $ url , $ this -> getRequestHeaders ( $ url , $ parameters ) , $ this -> getRequestBody ( $ parameters , $ files ) ) ; try { $ response = $ httpClient -> send ( $ request ) ; } catch ( GuzzleRequestException $ exception ) { $ response = $ exception -> getResponse ( ) ; } $ this -> validateAPIResponseCode ( $ request , $ response ) ; return $ response ; }
Call a Tulip API service.

@param string $serviceName
@param string $action
@param array  $parameters
@param array  $files

@return ResponseInterface

@throws RequestException
Call a Tulip API service .