Sets the request url.

@param string $url The url.

@return $this The current object.
496668
public function setUrl($url)
    {
        $this->url = $url;

        // Check if the url ends with a slash
        if ($this->url && substr($this->url, -1) !== '/') {
            $this->url .= '/';
        }

        return $this;
    }
454954
public static function setApiUrl($url)
    {
        $apiUrl = filter_var($url, FILTER_VALIDATE_URL);

        if (!$apiUrl) {
            throw new Exception\InvalidArgumentException(
                'API URL should be a valid url'
            );
        }

        self::$apiUrl = rtrim($url, '\\/');
    }
1037351
public function setUrl($url)
    {
        if (! empty($url)) {
            $segments = parse_url($url);

            foreach ($segments as $key => $value) {
                $this->$key = $value;
            }

            if ($this->format = pathinfo($this->path, PATHINFO_EXTENSION)) {
                $this->path = str_replace('.'.$this->format, '', $this->path);
            }
        }

        return $this;
    }
613582
public function removeUrl(Url $url)
    {
        if ($this->urls->contains($url)) {
            $this->urls->removeElement($url);
            $url->setSiteroot(null);
        }

        return $this;
    }
219243
public function url(string $url) : self
    {
        $this->route = $url;

        $this->active($url);

        return $this;
    }
21661
public function init($url = null)
    {
        $url       = (empty($url) ? Server::getInstance()->getCurrentUri() : $url);
        $this->url = parse_url($url);

        return $this;
    }
1204188
public function setUrl($url)
    {
        if (!filter_var($url, FILTER_VALIDATE_URL))
        {
            throw new InvalidDataException('Invalid url link');
        }

        $this->url = $url;

        return $this;
    }
696375
public function setUrl($url)
    {
        if (strlen($url) == 0) {
            throw new \InvalidArgumentException(sprintf('Enclosure URL should not be empty'));
        }

        $this->url = $url;

        return $this;
    }
1283689
public function setUrl ($url)
		{
			$this->authUrl = $url . '/oauth/authorize';
			$this->tokenUrl = $url . '/oauth/token';
			$this->apiBaseUrl = $url . '/api';
		}
1372912
public function setUrl($url)
    {
        if (!is_null($url) && !$url instanceof KHttpUrl) {
            throw new InvalidArgumentException('Invalid url type.');
        }

        $this->url = $url;
        return $this;
    }
1249267
public function setUrl( $url )
    {
        if( $url==null )
        {
            return null;
        }

        $urlParts = parse_url( $url );

        $this->scheme = $urlParts['scheme'];
        $this->host = $urlParts['host'];
        $this->user = $urlParts['user'];
        $this->password = $urlParts['pass'];
        $this->path = $urlParts['path'];
        $this->query = $urlParts['query'];
        $this->fragment = $urlParts['fragment'];
        $this->port = $urlParts['port'];

        return $this;
    }
937596
public function create($url)
        {
            // If no a protocol in URL, assume its a Laravel link
            if ( ! preg_match('!^\w+://! i', $url)) {
                $url = url($url);
            }

            $this->url = $url;
            $this->session = curl_init($this->url);

            return $this;
        }
355327
public function setUrl($url)
    {
      if(!is_string($url) && strlen(trim($url)) == 0)
        throw new InvalidArgumentException(__METHOD__ . '; Invalid url, must be a non empty string');

      $this->url = $url;
    }
1040982
public function link($url)
    {
        $this->element = 'a';
        if (is_string($url)) {
            $this->setAttr('href', $url);

            return $this;
        }
        $this->setAttr('href', $this->url($url));

        return $this;
    }
227871
public function setUrl($wsUrl)
    {
        $this->wsUrl = $wsUrl;
        $this->setClient(
            $this->createDefaultClient()
        );

        return $this;
    }
756301
public function setUrl(string $url) : Request
    {
        $components = parse_url($url);

        if ($components === false) {
            throw new \InvalidArgumentException('The URL provided is not valid.');
        }

        if (! isset($components['scheme'])) {
            throw new \InvalidArgumentException('The URL must have a scheme.');
        }

        $scheme = strtolower($components['scheme']);

        if ($scheme !== 'http' && $scheme !== 'https') {
            throw new \InvalidArgumentException(sprintf('The URL scheme "%s" is not acceptable.', $scheme));
        }

        $isSecure = ($scheme === 'https');

        if (! isset($components['host'])) {
            throw new \InvalidArgumentException('The URL must have a host name.');
        }

        $host = $components['host'];

        if (isset($components['port'])) {
            $port = $components['port'];
            $hostHeader = $host . ':' . $port;
        } else {
            $port = ($isSecure ? 443 : 80);
            $hostHeader = $host;
        }

        $this->path = isset($components['path']) ? $components['path'] : '/';
        $requestUri = $this->path;

        if (isset($components['query'])) {
            $this->queryString = $components['query'];
            parse_str($this->queryString, $this->query);
            $requestUri .= '?' . $this->queryString;
        } else {
            $this->queryString = '';
            $this->query = [];
        }

        $this->setHeader('Host', $hostHeader);

        $this->host = $host;
        $this->port = $port;
        $this->isSecure = $isSecure;
        $this->requestUri = $requestUri;

        return $this;
    }
497685
public function setRedirectUrl($redirectUrl = '')
    {
        $this->redirectUrl = $redirectUrl;
        $this->debug->debug(__FUNCTION__, 'setRedirectUrl: ' . json_encode($this->redirectUrl));

        return $this;
    }