@todo Change this URL to a route in the javascript app that will perform
the API request since the API expects the token as a POST parameter

@return string
494667
public function url()
    {
        $parameters = [
            'id'    => $this->userToken->getUserId(),
            'token' => $this->userToken->getToken(),
        ];

        $url = $this->urlGenerator->generate(
            'reset-password',
            $parameters,
            UrlGenerator::ABSOLUTE_URL
        );

        return $url;
    }
736738
public function requestLine()
    {
        $uri = $this->url->path();
        if ($this->url->query()) {
            $uri .= '?' . $this->url->query();
        }

        return sprintf('%s %s HTTP/%s', $this->method, $uri, $this->version);
    }
90542
public function getRequestedURI()
    {
        $endpoint = parse_url($this->apiEndpoint);

        // Replace Path of endpoint with requested path from curl
        $header = explode(' ', $this->curl->request_headers[0]);
        $endpoint['path'] = $header[1];

        return $endpoint['scheme'].'://'.$endpoint['host'].$endpoint['path'];
    }
354751
public function loginUrl()
    {
        $query = 'client_id=' . $this->app->getId() . '&redirect_uri=' . urlencode($this->callback) . '&response_type=code&state=' . $this->state;
        $query .= isset($this->scopes) ? '&scope=' . urlencode(str_replace(',', ' ', implode(',', $this->scopes))) : '';

        return sprintf('%s%s?%s', Constants::API_HOST, Constants::API_AUTH, $query);
    }
623192
public function getUrl()
    {
        if (!$this->isSortable()) {
            return '';
        }

        $params = ['sort_key' => $this->key];

        if ($this->isSortKey()) {
            $params['sort_order'] = $this->request->input('sort_order') == 'desc' ? 'asc' : 'desc';
        }

        return '?'.http_build_query($params + $this->request->all());
    }
1344417
protected function pullPost() {
		if (!is_array($this->postVars)) {
			$this->postVars = $this->request->getParsedBody();
			
			if (!is_array($this->postVars)) {
				$this->postVars = [];
			}
		}
		
		return $this->postVars;
	}
152974
public function to_postdata() {/*{{{*/
    $total = array();
    foreach ($this->parameters as $k => $v) {
      if (is_array($v)) {
        foreach ($v as $va) {
          $total[] = OAuthUtil::urlencode_rfc3986($k) . "[]=" . OAuthUtil::urlencode_rfc3986($va);
        }
      } else {
        $total[] = OAuthUtil::urlencode_rfc3986($k) . "=" . OAuthUtil::urlencode_rfc3986($v);
      }
    }
    $out = implode("&", $total);
    return $out;
  }
109899
protected function getTokenData() {
    $result = null;

    $request = ObjectFactory::getInstance('request');
    $token = $request->hasHeader(self::TOKEN_HEADER) ?
        trim(str_replace(self::AUTH_TYPE, '', $request->getHeader(self::TOKEN_HEADER))) : $this->token;
    if ($token !== null) {
      $jwt = (new Parser())->parse((string)$token);

      // validate
      $data = new ValidationData();
      $data->setIssuer($this->getTokenIssuer());
      if ($jwt->validate($data) && $jwt->verify($this->getTokenSigner(), $this->key)) {
        $result = $jwt->getClaims();
      }
    }
    return $result;
  }
757025
public function parse() : string
	{
		$raw_token = $this->_Request->getHeader($this->key);

		if(!$raw_token) {
			return '';
		}

		return trim( str_ireplace($this->prefix, '', $raw_token));
	}
726002
public function getLoginUrl()
    {
        // required params
        $params = array(
            'client_id' => $this->getClientId(),
            'redirect_uri' => $this->getRedirectUri(),
        );
        // optional params
        if ($this->getScope()) {
            $params['scope'] = implode(',', $this->getScope());
        }
        if ($this->getResponceType()) {
            $params['response_type'] = $this->getResponceType();
        }
        if ($this->apiVersion) {
            $params['v'] = $this->apiVersion;
        }
        if ($this->state) {
            $params['state'] = $this->state;
        }

        return 'https://oauth.vk.com/authorize?' . http_build_query($params);
    }
719686
private function getToken()
    {
        $vars = array(
            'method' => 'auth.getToken',
            'api_key' => $this->apiKey
        );

        $sig = $this->apiSig($this->apiSecret, $vars);
        $vars['api_sig'] = $sig;

        if ($call = $this->apiGetCall($vars)) {
            $this->token = $call->token;
        } else {
            return false;
        }
    }
138948
public function request() {
		if(!($vs_method = $this->getRequestMethod())) {
			return false;
		}

		$va_get = array();
		foreach($this->getAllGetParameters() as $vs_name => $vs_val) {
			$va_get[] = $vs_name."=".urlencode($vs_val);
		}

		if(strlen($this->ops_auth_token) > 0) {
			$va_get[] = 'authToken='.$this->ops_auth_token;
		}

		$vs_get = sizeof($va_get)>0 ? "?".join("&",$va_get) : "";

		$vs_query_url = preg_replace("/\/$/", '', $this->ops_service_url."/".$this->getEndpoint().$vs_get);
		$vo_handle = curl_init($vs_query_url);

		curl_setopt($vo_handle, CURLOPT_CUSTOMREQUEST, $vs_method);
		curl_setopt($vo_handle, CURLOPT_RETURNTRANSFER, true);
		curl_setopt($vo_handle, CURLOPT_SSL_VERIFYHOST, 0);
		curl_setopt($vo_handle, CURLOPT_SSL_VERIFYPEER, 0);
		curl_setopt($vo_handle, CURLOPT_FOLLOWLOCATION, true);

		$va_body = $this->getRequestBody();
		if(is_array($va_body) && sizeof($va_body)>0) {
			curl_setopt($vo_handle, CURLOPT_POSTFIELDS, json_encode($va_body));
		}

		$vs_exec = curl_exec($vo_handle);
		$vn_code = curl_getinfo($vo_handle, CURLINFO_HTTP_CODE);
		curl_close($vo_handle);

		if($vn_code == 401) { // try to re-authenticate if access denied
			// discard previous token
			if(strlen($this->ops_auth_token)) {
				@file_put_contents($this->ops_token_storage_path, '');
			}

			if(!$this->authenticate()) { // make up json result for failed authentication
				return new ServiceResult('{ "ok": false, "errors": ["access denied"] }');
			} else { // auth successful, try again
				return $this->request();
			}
		}

		return new ServiceResult($vs_exec);
	}
476102
public function toUrl() {
		$post_data = $this->toPostData();
		$out = $this->getNormalizedUrl();
		if ( $post_data ) {
			$out .= '?' . $post_data;
		}
		return $out;
	}
455800
public function getUrl()
    {
        if (empty($this->url)) {
            $url = $this->httpRequest()->getCurrentUrl(true)->getPath();
            // we need to have the trailing slash because of the match inside matchRequest
            // and also when matching the default method, we can do an incorrect match if we don't have the start and end slash
            $this->url = $this->str($url)->trimRight('/')->val() . '/';
        }

        return $this->url;
    }
1000514
public function getRequestToken()
    {
        return md5($this->getMerchantId().$this->getTransactionReference().$this->getAmount().$this->getSecretWord());
    }
417762
public function buildUrl()
    {

        $url = rtrim($this->apiUrl, '/') . '?';

        // Add token
        $url .= 'token=' . $this->diffbot->getToken();

        // Add query
        $url .= '&query=' . urlencode($this->query);

        // Add other options
        foreach ($this->otherOptions as $option => $value) {
            $url .= '&' . $option . '=' . $value;
        }

        return $url;
    }
1124963
public function authorizeUrl()
    {
        $request_token = $this->oauth('oauth/request_token', array('oauth_callback' => $this->callbackUrl));

        if ($request_token)
        {
            Session::put('oauth_token', $request_token['oauth_token']);
            Session::put('oauth_token_secret', $request_token['oauth_token_secret']);

            $url = $this->url('oauth/authorize', array('oauth_token' => $request_token['oauth_token']));
            return $url;
        }

        throw new TwitterOAuthException($request_token);
    }