protected function APICallWithOptions($requestType, $endpoint, $options,  $params = null)
    {
        $postkey = $this->httpClientVersionCheck();


        $response = $this->getHttpClient()->{$requestType}($this->buildRequestUrl($endpoint, $params), [

            'headers' => $this->getResponseHeaders($this->user->token),
            $postkey =>  $options

        ]);

        $return = json_decode($response->getBody(), true);

        return $return;

    }
protected function APICallWithOptions($requestType, $endpoint, $options,  $params = null)
    {
        $postkey = $this->httpClientVersionCheck();


        $response = $this->getHttpClient()->{$requestType}($this->buildRequestUrl($endpoint, $params), [

            'headers' => $this->getResponseHeaders($this->user->token),
            $postkey =>  $options

        ]);

        $return = json_decode($response->getBody(), true);

        return $return;

    }
protected function APICallWithOptions ( $ requestType , $ endpoint , $ options , $ params = null ) { $ postkey = $ this -> httpClientVersionCheck ( ) ; $ response = $ this -> getHttpClient ( ) -> { $ requestType } ( $ this -> buildRequestUrl ( $ endpoint , $ params ) , [ 'headers' => $ this -> getResponseHeaders ( $ this -> user -> token ) , $ postkey => $ options ] ) ; $ return = json_decode ( $ response -> getBody ( ) , true ) ; return $ return ; }
API call function for endpoints that require request body


@param $requestType
@param $endpoint
@param $options
@return mixed
API call function for endpoints that require request body