Builds the complete API endpoint url

@param string $method           The API method to call
@param string $method_template  The API method template to call

@return string The URL to send the request to
969325
protected function _getEndpoint($method, $method_template)
    {
        if (substr($method, 0, 5) == 'oauth') {
            $url = self::$_endpoint_oauth . $method;
        } else {
            $url = self::$_endpoint . $method . '.json';
        }
        return $url;
    }
1252677
public String route(String controllerClass, String method) {
        String route = router.getReverseRouteFor(controllerClass, method);
        if (route == null) {
            throw new TemplateProcessingException(ERR_FIND_ROUTE + controllerClass + "#" +
                    method);
        }
        return route;
    }
400159
protected function buildMethod(ReflectionMethod $method)
    {
        $argString = "";
        $paramString = "";
        foreach ($method->getParameters() as $value) {
            $argString .= "\${$value->getName()}, ";
            $paramString .= $this->getParamString($value);
        }

        $argString = trim($argString, ", ");
        $paramString = trim($paramString, ", ");
        $replaces = array(
            $method->getDocComment(),
            $method->getName(),
            $paramString,
            $argString
        );
        return str_replace(self::$methodTplSearches, $replaces, $this->template->getMethodTemplate());
    }
364259
protected function _mapFnInlineParams($method, &$apiparams)
  {
    $method_template = $method;
    $match           = [];
    if (preg_match_all('/[A-Z_]{2,}/', $method, $match)) {
      foreach ($match[0] as $param) {
        $param_l = strtolower($param);
        if ($param_l === 'resumeid') {
          $param_l = 'resumeId';
        }
        $method_template = str_replace($param, ':' . $param_l, $method_template);
        if (! isset($apiparams[$param_l])) {
          for ($i = 0; $i < 26; $i++) {
            $method_template = str_replace(chr(65 + $i), '_' . chr(97 + $i), $method_template);
          }
          throw new \Exception(
            'To call the templated method "' . $method_template
            . '", specify the parameter value for "' . $param_l . '".'
          );
        }
        $method  = str_replace($param, $apiparams[$param_l], $method);
        unset($apiparams[$param_l]);
      }
    }

    return [$method, $method_template];
  }
841701
protected function getEndpoint($method)
    {
        $number = $this->getArgument("number");
        $this->delArgument("number");
        $endpoint = "contacts";
        if (!is_null($number)) {
            $endpoint .= "/$number/variables";
        }
        $name = $this->getArgument("name");
        if (!is_null($name)) {
            $endpoint .= "/$name";
            $this->delArgument("name");
        }
        $queryString = array();
        $withContactLists = $this->getArgument("with_contact_lists");
        if (!is_null($withContactLists)) {
            $queryString['with_contact_lists'] = "true";
            $this->delArgument("with_contact_lists");
        }
        $page = $this->getArgument("page");
        if (!is_null($page)) {
            $queryString['page'] = $page;
            $this->delArgument("page");
        }
        if (!empty($queryString)) {
            $queryString = http_build_query($queryString);
            return "$endpoint?$queryString";
        }
        return $endpoint;
    }
727786
private function getUrlToOldApi($method, array $params, $format)
    {
        $queryString = sprintf(
            '?apikey=%s&format=%s&method=%s%s',
            $this->getApiKey(),
            $format,
            $method,
            $this->paramsQueryStringBuilder($params)
        );

        return sprintf(
            $this::API_URL,
            $this->getDc(),
            $this->getApiVersion(),
            $queryString
        );
    }
1371623
function encodeURL($method = null, array $method_params = array()) {
		return Main::encodeURL($this->parent->parentClass(), array($this->parent->parentId()), $method, $method_params, $this->parent->dataName());
	}
1041703
public function getMethodLimits( string $api_key, string $region, string $endpoint)
	{
		return @$this->limits[$region][$api_key]['method'][$endpoint];
	}
597598
public static function generate(string $url, string $method): string
    {
        $parts = \parse_url($url);

        // Remove "/wiki" part from the path for the Confluence
        // Really, I didn't find this part in the docs, but it works
        $path = \str_replace('/wiki', '', $parts['path']);
        $canonicalQuery = '';
        if (!empty($parts['query'])) {
            $query = $parts['query'];
            $queryParts = \explode('&', $query);
            $queryArray = [];
            foreach ($queryParts as $queryPart) {
                $pieces = \explode('=', $queryPart);
                $key = \array_shift($pieces);
                $key = \rawurlencode($key);
                $value = \mb_substr($queryPart, \mb_strlen($key) + 1);
                $value = \rawurlencode($value);
                $queryArray[$key][] = $value;
            }
            \ksort($queryArray);
            foreach ($queryArray as $key => $pieceOfQuery) {
                $pieceOfQuery = \implode(',', $pieceOfQuery);
                $canonicalQuery .= $key.'='.$pieceOfQuery.'&';
            }
            $canonicalQuery = \rtrim($canonicalQuery, '&');
        }

        return \hash('sha256', \implode('&', [\mb_strtoupper($method), $path, $canonicalQuery]));
    }
86948
public static function getParams(Request $request, $method = null)
    {
        if($method === null)
        {
            $method = $request->getMethod();
        }
        if(strtoupper($method) === Utils::$METHOD_GET)
        {
            return $request->query->all();
        } else if(strtoupper($method) === Utils::$METHOD_POST)
        {
            return $request->request->all();
        } else
        {
            return null;
        }
    }
374890
protected function buildOEmbedRequestUrl($resource, $endPoint, $format = self::FORMAT_DEFAULT)
    {
        $parameters = [
            'url' => $resource,
            'format' => $format,
            'version' => self::VERSION
        ];

        if ($this->getRequestParameters() !== null) {
            $parameters = Arrays::arrayMergeRecursiveOverrule($this->getRequestParameters()->toArray(), $parameters);
        }

        $urlParams = http_build_query($parameters, '', '&');
        $url = $endPoint . ((strpos($endPoint, '?') !== false) ? '&' : '?') . $urlParams;

        return $url;
    }
684526
def method_missing meth, *args, &block
      meth_s = meth.to_s
      if @method && meth_s =~ API_REGEX

        if meth_s.end_with?('!')
          # `foo! bar' is syntactic sugar for `foo.! bar'
          self[meth_s[0...-1]].!(args[0] || {})

        else
          # chain the method name onto URL path
          self[meth_s]
        end
      else
        super
      end
    end
863832
public function callEndpoint($endpoint, array $endpointParameters = [], $body = null, $method = HttpMethod::REQUEST_GET)
    {
        // Set the endpoint
        $this->setEndpoint($endpoint);
        // Set the parameters
        $this->setEndpointParameters($endpointParameters);
        // Set the body
        $this->setBody($body);
        // Set the HTTP method
        $this->setHttpMethod($method);
        // Call the endpoint
        $this->call();
        // return the result
        return $this->getResult();
    }
639411
public function api($endpoint, $method, $params = null)
    {
        $method = strtolower($method);

        try {
            $response = $this->app['twitter']->$method($endpoint, $params);
        } catch (\Exception $e) {
            $this->app['logger']->error($e);

            return false;
        }

        // log certain errors like rate limiting or expired tokens
        if (is_object($response) && property_exists($response, 'errors')) {
            foreach ($response->errors as $error) {
                if ($error->code == 88) {
                    $this->app['logger']->error("Hit Twitter rate limit on $endpoint with params: ".json_encode($params));
                } elseif ($error->code == 89) { // expired access token
                    // clear the access token of the user's profile
                    if ($this->profile) {
                        $this->profile->grantAllPermissions();
                        $this->profile->set(['access_token' => '', 'access_token_secret' => '']);
                        $this->profile->enforcePermissions();
                    }

                    // $this->app[ 'logger' ]->error( "Twitter access token expired on $endpoint with params: " . json_encode( $params ) );
                } elseif ($error->code == 231) {
                    $this->app['logger']->error("User must verify twitter login on $endpoint with params: ".json_encode($params));
                }
            }
        }

        return $response;
    }
1103483
public function getMethodTemplate()
    {
        if (!isset($this->methodTemplate)) {
            $this->methodTemplate = $this->_getMethodTemplate();
        }

        return $this->methodTemplate;
    }
1161652
protected function getEndpoint($method)
    {
        $endpoint = 'me/password';
        $reset = $this->getArgument('reset');
        $nonce = $this->getArgument('nonce');
        if (!is_null($reset)) {
            $endpoint .= '/reset';
            $this->delArgument('reset');
        }
        if (!is_null($nonce)) {
            $endpoint .= "/$nonce";
            $this->delArgument('nonce');
        }
        return $endpoint;
    }
258258
public function getMethodMutations(
        $method_name,
        Context $context
    ) {
        $project_analyzer = $this->getFileAnalyzer()->project_analyzer;
        $codebase = $project_analyzer->getCodebase();

        foreach ($this->class->stmts as $stmt) {
            if ($stmt instanceof PhpParser\Node\Stmt\ClassMethod &&
                strtolower($stmt->name->name) === strtolower($method_name)
            ) {
                $method_analyzer = new MethodAnalyzer($stmt, $this);

                $method_analyzer->analyze($context, null, true);
            } elseif ($stmt instanceof PhpParser\Node\Stmt\TraitUse) {
                foreach ($stmt->traits as $trait) {
                    $fq_trait_name = self::getFQCLNFromNameObject(
                        $trait,
                        $this->source->getAliases()
                    );

                    $trait_file_analyzer = $project_analyzer->getFileAnalyzerForClassLike($fq_trait_name);
                    $trait_node = $codebase->classlikes->getTraitNode($fq_trait_name);
                    $trait_aliases = $codebase->classlikes->getTraitAliases($fq_trait_name);
                    $trait_analyzer = new TraitAnalyzer(
                        $trait_node,
                        $trait_file_analyzer,
                        $fq_trait_name,
                        $trait_aliases
                    );

                    foreach ($trait_node->stmts as $trait_stmt) {
                        if ($trait_stmt instanceof PhpParser\Node\Stmt\ClassMethod &&
                            strtolower($trait_stmt->name->name) === strtolower($method_name)
                        ) {
                            $method_analyzer = new MethodAnalyzer($trait_stmt, $trait_analyzer);

                            $actual_method_id = (string)$method_analyzer->getMethodId();

                            if ($context->self && $context->self !== $this->fq_class_name) {
                                $analyzed_method_id = (string)$method_analyzer->getMethodId($context->self);
                                $declaring_method_id = $codebase->methods->getDeclaringMethodId($analyzed_method_id);

                                if ($actual_method_id !== $declaring_method_id) {
                                    break;
                                }
                            }

                            $method_analyzer->analyze($context, null, true);
                        }
                    }
                }
            }
        }
    }