protected function doPost($object, $url, $parameters)
    {
        $httpResponse = null;
        $headers = null;
        $postBody = null;
        $options = $this->httpClientOptions;

        try {
            $httpResponse = $this->client->post($url, $headers, $postBody, $options)
                ->setHeader('Content-Type', 'application/x-www-form-urlencoded')
                ->setBody(http_build_query($parameters))
                ->send();
        } catch (HttpException $e) {
            $msg = sprintf('%s. Http status code [%s]', $e->getMessage(), $e->getResponse()->getStatusCode());

            throw new RequestException($msg, 0, $e, $url, $parameters);
        } catch (\Exception $e) {
            throw new RuntimeException($e->getMessage(), 0, $e, $url, $parameters);
        }

        if (204 == $httpResponse->getStatusCode()) {
            return array();
        }

        try {
            $handler = $this->getHandler($httpResponse, $object);
            $result = $handler->parse()->getResult();
            $this->totalResults = $handler->getResultCount();

            return $result;
        } catch (ExceptionInterface $e) {
            $e->setUrl($url);
            $e->setParameters($parameters);

            throw $e;
        } catch (\Exception $e) {
            throw new RuntimeException($e->getMessage(), 0, $e, $url, $parameters);
        }
    }
protected function doPost($object, $url, $parameters)
    {
        $httpResponse = null;
        $headers = null;
        $postBody = null;
        $options = $this->httpClientOptions;

        try {
            $httpResponse = $this->client->post($url, $headers, $postBody, $options)
                ->setHeader('Content-Type', 'application/x-www-form-urlencoded')
                ->setBody(http_build_query($parameters))
                ->send();
        } catch (HttpException $e) {
            $msg = sprintf('%s. Http status code [%s]', $e->getMessage(), $e->getResponse()->getStatusCode());

            throw new RequestException($msg, 0, $e, $url, $parameters);
        } catch (\Exception $e) {
            throw new RuntimeException($e->getMessage(), 0, $e, $url, $parameters);
        }

        if (204 == $httpResponse->getStatusCode()) {
            return array();
        }

        try {
            $handler = $this->getHandler($httpResponse, $object);
            $result = $handler->parse()->getResult();
            $this->totalResults = $handler->getResultCount();

            return $result;
        } catch (ExceptionInterface $e) {
            $e->setUrl($url);
            $e->setParameters($parameters);

            throw $e;
        } catch (\Exception $e) {
            throw new RuntimeException($e->getMessage(), 0, $e, $url, $parameters);
        }
    }
protected function doPost ( $ object , $ url , $ parameters ) { $ httpResponse = null ; $ headers = null ; $ postBody = null ; $ options = $ this -> httpClientOptions ; try { $ httpResponse = $ this -> client -> post ( $ url , $ headers , $ postBody , $ options ) -> setHeader ( 'Content-Type' , 'application/x-www-form-urlencoded' ) -> setBody ( http_build_query ( $ parameters ) ) -> send ( ) ; } catch ( HttpException $ e ) { $ msg = sprintf ( '%s. Http status code [%s]' , $ e -> getMessage ( ) , $ e -> getResponse ( ) -> getStatusCode ( ) ) ; throw new RequestException ( $ msg , 0 , $ e , $ url , $ parameters ) ; } catch ( \ Exception $ e ) { throw new RuntimeException ( $ e -> getMessage ( ) , 0 , $ e , $ url , $ parameters ) ; } if ( 204 == $ httpResponse -> getStatusCode ( ) ) { return array ( ) ; } try { $ handler = $ this -> getHandler ( $ httpResponse , $ object ) ; $ result = $ handler -> parse ( ) -> getResult ( ) ; $ this -> totalResults = $ handler -> getResultCount ( ) ; return $ result ; } catch ( ExceptionInterface $ e ) { $ e -> setUrl ( $ url ) ; $ e -> setParameters ( $ parameters ) ; throw $ e ; } catch ( \ Exception $ e ) { throw new RuntimeException ( $ e -> getMessage ( ) , 0 , $ e , $ url , $ parameters ) ; } }
Makes the actual HTTP POST call to the API, parses the response and
returns the data if there is any. Throws exceptions in case of error.

@param string $object     The name of the object to perform an operation
on
@param string $url        The URL that will be accessed
@param array  $parameters The parameters to send

@access protected

@return mixed            In case of format=JSON it returns PHP arrays, if
format=XML it will either return a single
SimpleXMLElement or an array of SimpleXmlElements

@throws                  HGG\Pardot\RequestException
HGG\Pardot\RuntimeException
Makes the actual HTTP POST call to the API parses the response and returns the data if there is any . Throws exceptions in case of error .