You are here

public function OAuthRequest::to_header in OAuth 1.0 6

Same name and namespace in other branches
  1. 6.3 lib/OAuth.php \OAuthRequest::to_header()
  2. 7.3 lib/OAuth.php \OAuthRequest::to_header()

builds the Authorization: header

File

./OAuth.php, line 359

Class

OAuthRequest

Code

public function to_header() {

  /*{{{*/
  $out = '"Authorization: OAuth realm="",';
  $total = array();
  foreach ($this->parameters as $k => $v) {
    if (substr($k, 0, 5) != "oauth") {
      continue;
    }
    $out .= ',' . OAuthUtil::urlencodeRFC3986($k) . '="' . OAuthUtil::urlencodeRFC3986($v) . '"';
  }
  return $out;
}