HttpUrl url = new HttpUrl.Builder()
.scheme("https")
.host("www.google.com")
.addPathSegment("search")
.addQueryParameter("q", "polar bears")
.build();
System.out.println(url);
HttpUrl url = HttpUrl.parse("https://twitter.com/search?q=cute%20%23puppies&f=images");
for (int i = 0, size = url.querySize(); i < size; i++) {
System.out.println(url.queryParameterName(i) + ": " + url.queryParameterValue(i));
}
HttpUrl url = HttpUrl.parse("http://who-let-the-dogs.out").newBuilder()
.addPathSegment("_Who?_")
.query("_Who?_")
.fragment("_Who?_")
.build();
System.out.println(url);