Returns a new request created from a given {@link URI}.

@param uri {@link URI} to create new request.
@return {@link Request}
771868
@Override
  public Request newRequest(URI uri) {
    Request request = super.newRequest(uri);
    Request.Listener listener = new HttpRequestListener(tracer.getCurrentSpan(), handler);
    request.listener(listener);
    request.onComplete((Response.CompleteListener) listener);
    request.onResponseContent((Response.ContentListener) listener);
    return request;
  }
1192352
public URI rewriteURI(Request request) throws URISyntaxException {
        String path = request.path();
        if (!path.startsWith(prefix)) {
            return null;
        }

        StringBuilder uri = new StringBuilder(redirectTo);
        if (redirectTo.endsWith("/")) {
            uri.setLength(uri.length() - 1);
        }
        String rest = path.substring(prefix.length());
        if (!rest.startsWith("/") && !rest.isEmpty()) {
            uri.append("/");
        }
        uri.append(rest);

        // Do we have a query String
        int index = request.uri().indexOf("?");
        String query = null;
        if (index != -1) {
            // Remove the ?
            query = request.uri().substring(index + 1);
        }

        if (!Strings.isNullOrEmpty(query)) {
            uri.append("?").append(query);
        }

        return URI.create(uri.toString()).normalize();
    }
838720
public <T> HttpClientRequest.Builder<T> post(final URI uri, final HttpClientResponseHandler<T> httpHandler)
    {
        return new HttpClientRequest.Builder<T>(httpClientFactory, HttpClientMethod.POST, uri, httpHandler);
    }
20622
public <T> HttpClientRequest.Builder<T> put(final URI uri, final HttpClientResponseHandler<T> httpHandler)
    {
        return new HttpClientRequest.Builder<T>(httpClientFactory, HttpClientMethod.PUT, uri, httpHandler);
    }
741004
public static WebsocketClientTransport create(URI uri) {
    Objects.requireNonNull(uri, "uri must not be null");

    TcpClient client = createClient(uri);
    return create(HttpClient.from(client), uri.getPath());
  }
413599
private URI checkURI(String uri)
  {
    try
    {
      return new URI(Preconditions.checkNotNull(uri).trim());
    } catch (URISyntaxException e)
    {
      parser.getReport().message(MessageId.RSC_020, parser.getLocation(), uri);
      return null;
    }
  }
1239773
public static SamlEndpoint ofHttpPost(URI uri) {
        requireNonNull(uri, "uri");
        return new SamlEndpoint(uri, SamlBindingProtocol.HTTP_POST);
    }
137651
public static UriComponentsBuilder fromUri(URI uri) {
		UriComponentsBuilder builder = new UriComponentsBuilder();
		builder.uri(uri);
		return builder;
	}
1007972
public URI proxy(URI uri) {
        Proxy conf;
        String scheme;

        scheme = uri.getScheme();
        conf = proxies.get(scheme);
        if (conf == null || conf.excludes(uri)) {
            return null;
        }
        try {
            return new URI(scheme, null, conf.host, conf.port, null, null, null);
        } catch (URISyntaxException e) {
            throw new IllegalArgumentException(e);
        }
    }
1361008
public static URI url2uri(URL url) throws URISyntaxException {
		return new URI(
				url.getProtocol(),
				url.getAuthority(),
				url.getPath(),
				url.getQuery(),
				url.getRef());
	}
906129
function Request(Safe, uri, method) {
  if (!this)
    return new Request(Safe, uri, method);

  this.Safe = Safe;
  this.uri = uri;
  this.method = method;
  this._needAuth = false;
  this._returnMeta = false;
}
368922
public Query fromUrl(String uri) throws UrlBeautifier.UrlBeautificationException {
    Query query = fromUrl(uri, null);
    if (query == null) {
      throw new IllegalStateException("URL reference block is invalid, could not convert to query");
    }
    return query;
  }
434750
protected ClientHttpRequest createRequest(URI url, HttpMethod method) throws IOException {
		ClientHttpRequest request = getRequestFactory().createRequest(url, method);
		if (Log.isLoggable(TAG, Log.DEBUG)) {
			Log.d(TAG, "Created " + method.name() + " request for \"" + url + "\"");
		}
		return request;
	}
1341476
public URI toUri(final String stringUri) {
    try {
      final java.net.URI netUri = new java.net.URI(stringUri);
      return this.toEmfUri(netUri);
    } catch (Throwable _e) {
      throw Exceptions.sneakyThrow(_e);
    }
  }
301631
public <T> HttpClientRequest.Builder<T> get(final URI uri, final HttpClientResponseHandler<T> httpHandler)
    {
        return new HttpClientRequest.Builder<T>(httpClientFactory, HttpClientMethod.GET, uri, httpHandler);
    }
823926
private function createUri($uri)
    {
        if ($this->hasBaseUri() && (stripos($uri, $baseUri = (string) $this->getBaseUri()) === false)) {
            return $baseUri.$uri;
        }

        return $uri;
    }
860581
@Override
	public IResource newResource(URI uri) {
		final String sourceMethod = "newResource"; //$NON-NLS-1$
		boolean isTraceLogging = log.isLoggable(Level.FINER);
		if (isTraceLogging) {
			log.entering(AbstractAggregatorImpl.class.getName(), sourceMethod, new Object[]{uri});
		}
		Mutable<URI> uriRef = new MutableObject<URI>(uri);
		IResourceFactory factory = getResourceFactory(uriRef);
		IResource result;
		if (factory != null) {
			result = factory.newResource(uriRef.getValue());
		} else {
			result = new NotFoundResource(uriRef.getValue());
		}
		result = runConverters(result);
		if (isTraceLogging) {
			log.exiting(AbstractAggregatorImpl.class.getName(), sourceMethod, result);
		}
		return result;
	}