protected function buildAuthorizationHeaderForAPIRequest($method, UriInterface $uri, TokenInterface $token, $bodyParams = null)
 {
     $this->signature->setTokenSecret($token->getAccessTokenSecret());
     $parameters = $this->getBasicAuthorizationHeaderInfo();
     if (isset($parameters['oauth_callback'])) {
         unset($parameters['oauth_callback']);
     }
     $parameters = array_merge($parameters, ['oauth_token' => $token->getAccessToken()]);
     $parameters = array_merge($parameters, $bodyParams);
     $parameters['oauth_signature'] = $this->signature->getSignature($uri, $parameters, $method);
     $authorizationHeader = 'OAuth ';
     $delimiter = '';
     foreach ($parameters as $key => $value) {
         $authorizationHeader .= $delimiter . rawurlencode($key) . '="' . rawurlencode($value) . '"';
         $delimiter = ', ';
     }
     return $authorizationHeader;
 }
 /**
  * 
  * @param type $method
  * @param UriInterface $uri
  * @param \OAuth\OAuth1\Token\TokenInterface $token
  * @param type $bodyParams
  * @return string
  */
 protected function buildAuthorizationHeaderForAPIRequest($method, UriInterface $uri, \OAuth\OAuth1\Token\TokenInterface $token, $bodyParams = null)
 {
     $this->signature->setTokenSecret($token->getAccessTokenSecret());
     $authParameters = $this->getBasicAuthorizationHeaderInfo();
     if (isset($authParameters['oauth_callback'])) {
         unset($authParameters['oauth_callback']);
     }
     $authParameters = array_merge($authParameters, array('oauth_token' => $token->getAccessToken()));
     $authParameters = is_array($bodyParams) ? array_merge($authParameters, $bodyParams) : $authParameters;
     //In base class here is because $bodyParams array is never merged with $authParameters
     $authParameters['oauth_signature'] = $this->signature->getSignature($uri, $authParameters, $method);
     if (isset($bodyParams['oauth_session_handle'])) {
         $authParameters['oauth_session_handle'] = $bodyParams['oauth_session_handle'];
         unset($bodyParams['oauth_session_handle']);
     }
     $authorizationHeader = 'OAuth ';
     $delimiter = '';
     foreach ($authParameters as $key => $value) {
         $authorizationHeader .= $delimiter . rawurlencode($key) . '="' . rawurlencode($value) . '"';
         $delimiter = ', ';
     }
     return $authorizationHeader;
 }