MangoPay/Libraries/RestTool.php
private function GetHttpHeaders($idempotencyKey = null)
    {
        // return if already created...
        if (!is_null($this->_requestHttpHeaders)) {
            return $this->_requestHttpHeaders;
        }
        // ...or initialize with default headers
        $this->_requestHttpHeaders = array();
        // content type
        array_push($this->_requestHttpHeaders, self::$_JSON_HEADER);
        // Add User-Agent Header
        array_push($this->_requestHttpHeaders, 'User-Agent: MangoPay V2 PHP/' . self::VERSION);
        // Authentication http header
        if ($this->_authRequired) {
            $authHlp = new AuthenticationHelper($this->_root);
            array_push($this->_requestHttpHeaders, $authHlp->GetHttpHeaderKey());
        }
        if ($idempotencyKey != null) {
            array_push($this->_requestHttpHeaders, 'Idempotency-Key: ' . $idempotencyKey);
        }
        return $this->_requestHttpHeaders;
    }
private function GetHttpHeaders($idempotencyKey = null)
    {
        // return if already created...
        if (!is_null($this->_requestHttpHeaders)) {
            return $this->_requestHttpHeaders;
        }
        // ...or initialize with default headers
        $this->_requestHttpHeaders = array();
        // content type
        array_push($this->_requestHttpHeaders, self::$_JSON_HEADER);
        // Add User-Agent Header
        array_push($this->_requestHttpHeaders, 'User-Agent: MangoPay V2 PHP/' . self::VERSION);
        // Authentication http header
        if ($this->_authRequired) {
            $authHlp = new AuthenticationHelper($this->_root);
            array_push($this->_requestHttpHeaders, $authHlp->GetHttpHeaderKey());
        }
        if ($idempotencyKey != null) {
            array_push($this->_requestHttpHeaders, 'Idempotency-Key: ' . $idempotencyKey);
        }
        return $this->_requestHttpHeaders;
    }
private function GetHttpHeaders ( $ idempotencyKey = null ) { // return if already created... if ( ! is_null ( $ this -> _requestHttpHeaders ) ) { return $ this -> _requestHttpHeaders ; } // ...or initialize with default headers $ this -> _requestHttpHeaders = array ( ) ; // content type array_push ( $ this -> _requestHttpHeaders , self :: $ _JSON_HEADER ) ; // Add User-Agent Header array_push ( $ this -> _requestHttpHeaders , 'User-Agent: MangoPay V2 PHP/' . self :: VERSION ) ; // Authentication http header if ( $ this -> _authRequired ) { $ authHlp = new AuthenticationHelper ( $ this -> _root ) ; array_push ( $ this -> _requestHttpHeaders , $ authHlp -> GetHttpHeaderKey ( ) ) ; } if ( $ idempotencyKey != null ) { array_push ( $ this -> _requestHttpHeaders , 'Idempotency-Key: ' . $ idempotencyKey ) ; } return $ this -> _requestHttpHeaders ; }
Get HTTP header to use in request
@param string $idempotencyKey Key for response replication
@return array Array with HTTP headers
Get HTTP header to use in request