You are here

private function dropbox::_build_header in Dropbox Client 7

Same name and namespace in other branches
  1. 7.4 dropbox.php \dropbox::_build_header()
  2. 7.2 dropbox.php \dropbox::_build_header()
  3. 7.3 dropbox.php \dropbox::_build_header()
3 calls to dropbox::_build_header()
dropbox::_content_request in ./dropbox.php
dropbox::_post_request in ./dropbox.php
dropbox::_response_request in ./dropbox.php

File

./dropbox.php, line 423

Class

dropbox

Code

private function _build_header($url, $method, $prepend, $append, $overwrite = array()) {
  $str = $prepend === false ? '' : $prepend;
  foreach ($this->_header as $key => $value) {
    if (array_key_exists($key, $overwrite)) {
      $str .= $key . ': ' . $overwrite[$key] . self::LINE_END;
    }
    else {
      $str .= $key . ': ' . $value . self::LINE_END;
    }
  }
  if ($this->_access !== false && $url !== false) {
    $str .= get_auth_header($url, $this->_consumer['key'], $this->_consumer['secret'], $this->_access, $method, $this->_consumer['algorithm']);
  }
  $str .= $append === false ? '' : $append;
  return $str;
}