public function Url::setHost

Set the host of the request.

Parameters

string $host Host to set (e.g. www.yahoo.com, yahoo.com):

Return value

Url

File

drupal/core/vendor/guzzle/http/Guzzle/Http/Url.php, line 181

Class

Url
Parses and generates URLs based on URL parts. In favor of performance, URL parts are not validated.

Namespace

Guzzle\Http

Code

public function setHost($host) {
  if (strpos($host, ':') === false) {
    $this->host = $host;
  }
  else {
    list($host, $port) = explode(':', $host);
    $this->host = $host;
    $this
      ->setPort($port);
  }
  return $this;
}