src/Services/BaseRestService.php
private function buildRequestHeaders($body)
    {
        $headers = $this->getEbayHeaders();

        $headers['Accept'] = 'application/json';
        $headers['Content-Type'] = 'application/json';
        $headers['Content-Length'] = strlen($body);

        // Add optional headers.
        if ($this->getConfig('requestLanguage')) {
            $headers[self::HDR_REQUEST_LANGUAGE] = $this->getConfig('requestLanguage');
        }

        if ($this->getConfig('responseLanguage')) {
            $headers[self::HDR_RESPONSE_LANGUAGE] = $this->getConfig('responseLanguage');
        }

        if ($this->getConfig('compressResponse')) {
            $headers[self::HDR_RESPONSE_ENCODING] = 'application/gzip';
        }

        return $headers;
    }
private function buildRequestHeaders($body)
    {
        $headers = $this->getEbayHeaders();

        $headers['Accept'] = 'application/json';
        $headers['Content-Type'] = 'application/json';
        $headers['Content-Length'] = strlen($body);

        // Add optional headers.
        if ($this->getConfig('requestLanguage')) {
            $headers[self::HDR_REQUEST_LANGUAGE] = $this->getConfig('requestLanguage');
        }

        if ($this->getConfig('responseLanguage')) {
            $headers[self::HDR_RESPONSE_LANGUAGE] = $this->getConfig('responseLanguage');
        }

        if ($this->getConfig('compressResponse')) {
            $headers[self::HDR_RESPONSE_ENCODING] = 'application/gzip';
        }

        return $headers;
    }
private function buildRequestHeaders ( $ body ) { $ headers = $ this -> getEbayHeaders ( ) ; $ headers [ 'Accept' ] = 'application/json' ; $ headers [ 'Content-Type' ] = 'application/json' ; $ headers [ 'Content-Length' ] = strlen ( $ body ) ; // Add optional headers. if ( $ this -> getConfig ( 'requestLanguage' ) ) { $ headers [ self :: HDR_REQUEST_LANGUAGE ] = $ this -> getConfig ( 'requestLanguage' ) ; } if ( $ this -> getConfig ( 'responseLanguage' ) ) { $ headers [ self :: HDR_RESPONSE_LANGUAGE ] = $ this -> getConfig ( 'responseLanguage' ) ; } if ( $ this -> getConfig ( 'compressResponse' ) ) { $ headers [ self :: HDR_RESPONSE_ENCODING ] = 'application/gzip' ; } return $ headers ; }
Helper function that builds the HTTP request headers.

@param string $body The request body.

@return array An associative array of HTTP headers.
Helper function that builds the HTTP request headers .