code: public function withUri(UriInterface $uri, $preserve = false)
      {
          $static = clone $this;
  
          $static->uri = $uri;
  
          if (! $preserve && $host = $uri->getHost()) {
              $port = $host . ':' . $uri->getPort();
  
              $host = $uri->getPort() ? $port : $host;
  
              $static->headers['Host'] = (array) $host;
          }
  
          return $static;
      }
docs: Returns an instance with the provided URI.
  
  @param  \Psr\Http\Message\UriInterface $uri
  @param  boolean                        $preserve
  @return static