public function executeRequest($method, $url, $token, $body = null)
    {
        $options = [];
        if ($body) {
            $options['body'] = json_encode($body);
            $options['headers']['Content-Type'] = 'application/json';
        }

        $request = $this->getAuthenticatedRequest($method, $this->apiDomain.'/'.$this->version.$url, $token, $options);

        return $this->getParsedResponse($request);
    }
public function executeRequest($method, $url, $token, $body = null)
    {
        $options = [];
        if ($body) {
            $options['body'] = json_encode($body);
            $options['headers']['Content-Type'] = 'application/json';
        }

        $request = $this->getAuthenticatedRequest($method, $this->apiDomain.'/'.$this->version.$url, $token, $options);

        return $this->getParsedResponse($request);
    }
public function executeRequest ( $ method , $ url , $ token , $ body = null ) { $ options = [ ] ; if ( $ body ) { $ options [ 'body' ] = json_encode ( $ body ) ; $ options [ 'headers' ] [ 'Content-Type' ] = 'application/json' ; } $ request = $ this -> getAuthenticatedRequest ( $ method , $ this -> apiDomain . '/' . $ this -> version . $ url , $ token , $ options ) ; return $ this -> getParsedResponse ( $ request ) ; }
Generate request, execute it and return parsed response
@param  string $method
@param  string $url
@param  AccessToken|string|null $token
@param  mixed  $body
@return mixed
Generate request execute it and return parsed response