private Request( URI uri, String method, ListMultimap<String, String> headers, BodyGenerator bodyGenerator, boolean followRedirects, boolean preserveAuthorizationOnRedirect) { requireNonNull(uri, "uri is null"); checkArgument(uri.getHost() != null, "uri does not have a host: %s", uri); checkArgument(uri.getScheme() != null, "uri does not have a scheme: %s", uri); String scheme = uri.getScheme().toLowerCase(); checkArgument("http".equals(scheme) || "https".equals(scheme), "uri scheme must be http or https: %s", uri); requireNonNull(method, "method is null"); this.uri = validateUri(uri); this.method = method; this.headers = ImmutableListMultimap.copyOf(headers); this.bodyGenerator = bodyGenerator; this.followRedirects = followRedirects; this.preserveAuthorizationOnRedirect = preserveAuthorizationOnRedirect; }