@Override public Request scheme(String scheme) { this.scheme = scheme; this.uri = buildURI(); return this; }
@Override public URI getURI() { if (uri == null) uri = buildURI(true); @SuppressWarnings("ReferenceEquality") boolean isNullURI = (uri == NULL_URI); return isNullURI ? null : uri; }
@Override public Request path(String path) { this.path = path; this.uri = buildURI(); return this; }
@Override public Request scheme(String scheme) { this.scheme = scheme; this.uri = buildURI(); return this; }
@Override public Request path(String path) { this.path = path; this.uri = buildURI(); return this; }
@Override public Request path(String path) { URI uri = newURI(path); if (uri == null) { this.path = path; this.query = null; } else { String rawPath = uri.getRawPath(); if (rawPath == null) rawPath = ""; this.path = rawPath; String query = uri.getRawQuery(); if (query != null) { this.query = query; params.clear(); extractParams(query); } if (uri.isAbsolute()) this.path = buildURI(false).toString(); } this.uri = null; return this; }
protected HttpRequest(HttpClient client, long conversation, URI uri) { this.client = client; this.conversation = conversation; scheme = uri.getScheme(); host = uri.getHost(); port = client.normalizePort(scheme, uri.getPort()); path = uri.getRawPath(); String query = uri.getRawQuery(); if (query != null) { for (String nameValue : query.split("&")) { String[] parts = nameValue.split("="); param(parts[0], parts.length < 2 ? "" : urlDecode(parts[1])); } } this.uri = buildURI(); followRedirects(client.isFollowRedirects()); }
protected HttpRequest(HttpClient client, long conversation, URI uri) { this.client = client; this.conversation = conversation; scheme = uri.getScheme(); host = uri.getHost(); port = client.normalizePort(scheme, uri.getPort()); path = uri.getRawPath(); String query = uri.getRawQuery(); if (query != null) { for (String nameValue : query.split("&")) { String[] parts = nameValue.split("="); param(parts[0], parts.length < 2 ? "" : urlDecode(parts[1])); } } this.uri = buildURI(); followRedirects(client.isFollowRedirects()); }