private function getRequest($options)
    {
        $headers = isset($options['headers']) ? $options['headers'] : [];
        $headers['User-Agent'] = 'sanity-php ' . Version::VERSION;

        if (!empty($this->clientConfig['token'])) {
            $headers['Authorization'] = 'Bearer ' . $this->clientConfig['token'];
        }

        $method = isset($options['method']) ? $options['method'] : 'GET';
        $body = isset($options['body']) ? $options['body'] : null;
        $cdnAllowed = (
            isset($options['cdnAllowed']) &&
            $options['cdnAllowed'] &&
            $this->clientConfig['useCdn']
        );

        $baseUrl = $cdnAllowed
            ? $this->clientConfig['cdnUrl']
            : $this->clientConfig['url'];

        $url = $baseUrl . $options['url'];

        return new Request($method, $url, $headers, $body);
    }
private function getRequest($options)
    {
        $headers = isset($options['headers']) ? $options['headers'] : [];
        $headers['User-Agent'] = 'sanity-php ' . Version::VERSION;

        if (!empty($this->clientConfig['token'])) {
            $headers['Authorization'] = 'Bearer ' . $this->clientConfig['token'];
        }

        $method = isset($options['method']) ? $options['method'] : 'GET';
        $body = isset($options['body']) ? $options['body'] : null;
        $cdnAllowed = (
            isset($options['cdnAllowed']) &&
            $options['cdnAllowed'] &&
            $this->clientConfig['useCdn']
        );

        $baseUrl = $cdnAllowed
            ? $this->clientConfig['cdnUrl']
            : $this->clientConfig['url'];

        $url = $baseUrl . $options['url'];

        return new Request($method, $url, $headers, $body);
    }
private function getRequest ( $ options ) { $ headers = isset ( $ options [ 'headers' ] ) ? $ options [ 'headers' ] : [ ] ; $ headers [ 'User-Agent' ] = 'sanity-php ' . Version :: VERSION ; if ( ! empty ( $ this -> clientConfig [ 'token' ] ) ) { $ headers [ 'Authorization' ] = 'Bearer ' . $ this -> clientConfig [ 'token' ] ; } $ method = isset ( $ options [ 'method' ] ) ? $ options [ 'method' ] : 'GET' ; $ body = isset ( $ options [ 'body' ] ) ? $ options [ 'body' ] : null ; $ cdnAllowed = ( isset ( $ options [ 'cdnAllowed' ] ) && $ options [ 'cdnAllowed' ] && $ this -> clientConfig [ 'useCdn' ] ) ; $ baseUrl = $ cdnAllowed ? $ this -> clientConfig [ 'cdnUrl' ] : $ this -> clientConfig [ 'url' ] ; $ url = $ baseUrl . $ options [ 'url' ] ; return new Request ( $ method , $ url , $ headers , $ body ) ; }
Returns an instance of Request based on the given options and client configuration.

@param array $options Array of options for this request.
@return GuzzleHttp\Psr7\Request Returns an initialized request.
Returns an instance of Request based on the given options and client configuration .