protected function sendData($verb, $parameters)
    {
        // Set the endpoint
        $endpoint = $this->buildEndpoint();

        // Set the header
        $this->buildHttpHeader();

        // Send the request
        $client = new Client(); //GuzzleHttp\Client

        $error = true;
        try {

            $response = $client->request($verb, $endpoint, $parameters);

            $error = false;

        } catch (\GuzzleException $e) {
            $this->errorMessage = $e->getResponse()->getBody()->getContents();

        } catch (\GuzzleHttp\Exception\ClientException $e) {
            $this->errorMessage = $e->getResponse()->getBody()->getContents();

        } catch (\GuzzleHttp\Exception\ServerException $e) {
            $this->errorMessage = $e->getResponse()->getBody()->getContents();

        } catch (Exception $e) {
            $this->errorMessage = 'Unknown Exception in Guzzle request';

        }

        return $error ? (! $error) : json_decode($response->getBody(), true);
    }
protected function sendData($verb, $parameters)
    {
        // Set the endpoint
        $endpoint = $this->buildEndpoint();

        // Set the header
        $this->buildHttpHeader();

        // Send the request
        $client = new Client(); //GuzzleHttp\Client

        $error = true;
        try {

            $response = $client->request($verb, $endpoint, $parameters);

            $error = false;

        } catch (\GuzzleException $e) {
            $this->errorMessage = $e->getResponse()->getBody()->getContents();

        } catch (\GuzzleHttp\Exception\ClientException $e) {
            $this->errorMessage = $e->getResponse()->getBody()->getContents();

        } catch (\GuzzleHttp\Exception\ServerException $e) {
            $this->errorMessage = $e->getResponse()->getBody()->getContents();

        } catch (Exception $e) {
            $this->errorMessage = 'Unknown Exception in Guzzle request';

        }

        return $error ? (! $error) : json_decode($response->getBody(), true);
    }
protected function sendData ( $ verb , $ parameters ) { // Set the endpoint $ endpoint = $ this -> buildEndpoint ( ) ; // Set the header $ this -> buildHttpHeader ( ) ; // Send the request $ client = new Client ( ) ; //GuzzleHttp\Client $ error = true ; try { $ response = $ client -> request ( $ verb , $ endpoint , $ parameters ) ; $ error = false ; } catch ( \ GuzzleException $ e ) { $ this -> errorMessage = $ e -> getResponse ( ) -> getBody ( ) -> getContents ( ) ; } catch ( \ GuzzleHttp \ Exception \ ClientException $ e ) { $ this -> errorMessage = $ e -> getResponse ( ) -> getBody ( ) -> getContents ( ) ; } catch ( \ GuzzleHttp \ Exception \ ServerException $ e ) { $ this -> errorMessage = $ e -> getResponse ( ) -> getBody ( ) -> getContents ( ) ; } catch ( Exception $ e ) { $ this -> errorMessage = 'Unknown Exception in Guzzle request' ; } return $ error ? ( ! $ error ) : json_decode ( $ response -> getBody ( ) , true ) ; }
Execute a PUT or POST request

@param $verb
@return bool|mixed
@throws \GuzzleHttp\Exception\GuzzleException
Execute a PUT or POST request