Build a HttpRequest instance.
@param type $requestedUrl
@return HttpRequest
430006
public static function buildFromRequestUrl($requestedUrl) {
        /* correct path */
        $basePath = (is_null(Enlace::get("base_path"))?'':Enlace::get("base_path"));
        $requestedUrl = str_replace($basePath, '', $requestedUrl);
        
        $instance = new HttpRequest();
        $instance->setRequestedUrl($requestedUrl);

        /* strip get parameters */
        $arrayParam = explode('?', $requestedUrl);
        if (count($arrayParam) > 1) {
            $explodedUrl = explode('/', $arrayParam[0]);
        } else {
            $explodedUrl = explode('/', $requestedUrl);
        }

        /* i18n */
        $baseIndex = 0;
        if (isset($explodedUrl[1]) && !is_null(Enlace::get("lang", "available"))) {
            foreach (Enlace::get("lang", "available") as $lang => $desc) {
                if ($explodedUrl[1] == $lang) {
                    $instance->setLang($explodedUrl[1]);
                    $requestedUrl = str_replace("/" . $lang, "", $requestedUrl);
                    $baseIndex = 1;
                    break;
                }
            }
        }

        /* look for registered routes */
        $registeredRoutes = Enlace::getRoutes();
        $route = null;
        $parameters = array();
        foreach ($registeredRoutes as $pattern => $foundRouteVal) {
            /* pattern to regex */
            $filterSlashes = preg_replace("/\//i", '\/', preg_replace("/:[^\/]*/i", '.*', $pattern));
            $regex = "/" . $filterSlashes . "$/";
            if (preg_match($regex, $requestedUrl)) {
                if (isset($foundRouteVal["method"]) && strtolower($_SERVER['REQUEST_METHOD']) != strtolower($foundRouteVal["method"])) {
                    continue;
                }

                /* fill parameters */
                $params = preg_grep("/:\b/", explode("/", $pattern));
                $explodedPattern = explode("/", $pattern);
                for ($pos = 0; $pos < count($explodedPattern); $pos++) {
                    if (in_array($explodedPattern[$pos], $params)) {
                        $paramId = str_replace(":", "", $explodedPattern[$pos]);
                        $parameters[$paramId] = $explodedUrl[$pos + $baseIndex];
                    }
                }
                /* set values */
                $instance->setParams($parameters);
                $route = $foundRouteVal;
                break;
            }
        }

        if (!is_null($route)) {
            if (isset($route["controller"])) {
                $pos = strpos($route["controller"], ":");
                if ($pos !== false && $pos == 0) {
                    $instance->setControllerName($instance->getParameter(substr($route["controller"], 1)));
                } else {
                    $instance->setControllerName($route["controller"]);
                }
            }
            if (isset($route["action"])) {
                $pos = strpos($route["action"], ":");
                if ($pos !== false && $pos == 0) {
                    $instance->setAction($instance->getParameter(substr($route["action"], 1)));
                } else {
                    $instance->setAction($route["action"]);
                }
            }
        }

        return $instance;
    }
24375
public function setUrl(string $url): RequestContext
    {
        $this->assertValidUrl($url);

        $this->url = $url;

        return $this;
    }
656284
private function buildRequestUrl()
    {
        if (!empty($_SERVER['REQUEST_URI'])) {
            return sprintf(
                '%s://%s%s%s',
                $this->guessProtocol(),
                $this->guessHost(),
                $this->guessPort(),
                $_SERVER['REQUEST_URI']
            );
        }
    }
868745
public function build(): SetBlockedURLsRequest
	{
		$instance = new SetBlockedURLsRequest();
		if ($this->urls === null) {
			throw new BuilderException('Property [urls] is required.');
		}
		$instance->urls = $this->urls;
		return $instance;
	}
371297
private function buildRequest($url, array $headers = []): RequestInterface
    {
        $request = $this->requestFactory->createRequest('GET', $url);
        foreach ($headers as $header => $value) {
            $request = $request->withHeader($header, $value);
        }

        return $request;
    }
26256
public function request($url, array $parameters = [], $requestMethod = 'GET')
    {
        try {
            $method = strtolower($requestMethod) === 'get' ? 'query' : 'form_params';
            $response = $this->getClient()->request($requestMethod, $url, [
                $method  => array_merge($this->getParams(), $parameters),
                'Accept' => 'application/json'
            ]);
            return json_decode($response->getBody());
        } catch (RequestException $e) {
            $this->printErrorMessage(Psr7\str($e->getResponse()), false);
        }
        return [];
    }
632094
public function buildRouter() : HTTPRouter
    {
        // create router dependencies and router instance
        $request = new HTTPInputRequestDefault();
        $response = new HTTPOutputResponseDefault($request);
        $errHandler = new HTTPErrorHandlerDefault();
        $router = new HTTPRouterDefault($request, $response, $errHandler);

        // prepare authorizations
        $authorizationDisabled = new AuthorizationDisabled();

        // add your routes here
        $router->addRoute(new HTTPRouteExample($request, $response, $authorizationDisabled));

        // return
        return $router;
    }
1269138
private function createHttpGetRequest($url, array $params = [])
    {
        $url .= (count($params) > 0 ? '?' . http_build_query($params, null, '&', PHP_QUERY_RFC3986) : '');

        return new Request('GET', $url);
    }
51444
static function build($required=null, $optional=null,
                   $policy_url=null,
                   $sreg_ns_uri=Auth_OpenID_SREG_NS_URI,
                   $cls='Auth_OpenID_SRegRequest')
    {
        /** @var Auth_OpenID_SRegRequest $obj */
        $obj = new $cls();

        $obj->required = array();
        $obj->optional = array();
        $obj->policy_url = $policy_url;
        $obj->ns_uri = $sreg_ns_uri;

        if ($required) {
            if (!$obj->requestFields($required, true, true)) {
                return null;
            }
        }

        if ($optional) {
            if (!$obj->requestFields($optional, false, true)) {
                return null;
            }
        }

        return $obj;
    }
47087
public function buildComplete($url = null, $full = false) {
		if (is_array($url)) {
			$url = $this->addQueryStrings($url);
		}

		return Router::url($url, $full);
	}
247665
public function performRequest($url)
    {
        $client = $this->getClient();

        return $this->response = $client->get($url);
    }
552579
protected function buildRequest()
    {
        $request = new Request($this->helper());
        $request->setRouter($this->router());

        return $request;
    }
25025
public function load($url)
    {
        $masterRequest = $this->requestStack->getMasterRequest();
        $request = Request::create($url, 'GET', array(), $masterRequest->cookies->all(), array(), $masterRequest->server->all());
        if ($masterRequest->getSession()) {
            $request->setSession($masterRequest->getSession());
        }

        $response = $this->kernel->handle($request, HttpKernelInterface::SUB_REQUEST, false);

        return $response->getContent();
    }
1317925
static function parse(string $url, ?int $preferredFormat = self::ABSOLUTE)
    {
        $components = parse_url($url);

        if ($components === false) {
            throw new InvalidUrlException(sprintf('The given URL "%s" is invalid', $url));
        }

        $query = [];

        if (isset($components['query'])) {
            parse_str($components['query'], $query);
        }

        return new static(
            $components['scheme'] ?? null,
            $components['host'] ?? null,
            $components['port'] ?? null,
            $components['path'] ?? '',
            $query,
            $components['fragment'] ?? null,
            $preferredFormat
        );
    }
922780
public function get($url = null, $requestBody = null)
    {
        if(!empty($requestBody))
        {
            if(strpos($url, '?'))
            {
                $url .= '&';
            }
            else
            {
                $url .= '?';
            }
            $url .= http_build_query($requestBody, '', '&');
        }
        return $this->send($url, array(), 'GET');
    }
878785
public function build(): StartWorkerRequest
	{
		$instance = new StartWorkerRequest();
		if ($this->scopeURL === null) {
			throw new BuilderException('Property [scopeURL] is required.');
		}
		$instance->scopeURL = $this->scopeURL;
		return $instance;
	}
805902
public function build(): RequestEntriesRequest
	{
		$instance = new RequestEntriesRequest();
		if ($this->cacheId === null) {
			throw new BuilderException('Property [cacheId] is required.');
		}
		$instance->cacheId = $this->cacheId;
		if ($this->skipCount === null) {
			throw new BuilderException('Property [skipCount] is required.');
		}
		$instance->skipCount = $this->skipCount;
		if ($this->pageSize === null) {
			throw new BuilderException('Property [pageSize] is required.');
		}
		$instance->pageSize = $this->pageSize;
		$instance->pathFilter = $this->pathFilter;
		return $instance;
	}