You are here

function OAuthRequestSigner::getAuthorizationHeader in Lingotek Translation 7.3

Same name and namespace in other branches
  1. 7.2 lib/oauth-php/library/OAuthRequestSigner.php \OAuthRequestSigner::getAuthorizationHeader()

* Builds the Authorization header for the request. * Adds all oauth_ and xoauth_ parameters to the Authorization header. * *

Return value

string

1 call to OAuthRequestSigner::getAuthorizationHeader()
OAuthRequester::curl_raw in lib/oauth-php/library/OAuthRequester.php
* Open and close a curl session passing all the options to the curl libs * *

File

lib/oauth-php/library/OAuthRequestSigner.php, line 159

Class

OAuthRequestSigner

Code

function getAuthorizationHeader() {
  if (!$this->signed) {
    $this
      ->sign($this->usr_id);
  }
  $h = array();
  $h[] = 'Authorization: OAuth realm=""';
  foreach ($this->param as $name => $value) {
    if (strncmp($name, 'oauth_', 6) == 0 || strncmp($name, 'xoauth_', 7) == 0) {
      $h[] = $name . '="' . $value . '"';
    }
  }
  $hs = implode(', ', $h);
  return $hs;
}