You are here

function OAuthRequestSigner::getQueryString in Lingotek Translation 7.3

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

* Builds the application/x-www-form-urlencoded parameter string. Can be appended as * the query part to a GET or inside the request body for a POST. * *

Parameters

boolean oauth_as_header (optional) set to false to include oauth parameters: * @return string

1 call to OAuthRequestSigner::getQueryString()
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 186

Class

OAuthRequestSigner

Code

function getQueryString($oauth_as_header = true) {
  $parms = array();
  foreach ($this->param as $name => $value) {
    if (!$oauth_as_header || strncmp($name, 'oauth_', 6) != 0 && strncmp($name, 'xoauth_', 7) != 0) {
      if (is_array($value)) {
        foreach ($value as $v) {
          $parms[] = $name . '=' . $v;
        }
      }
      else {
        $parms[] = $name . '=' . $value;
      }
    }
  }
  return implode('&', $parms);
}