Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Uri builtUri = Uri.parse(BASE_URL).buildUpon()
// add various params
.appendQueryParameter(PARAM_QUERY, githubSearchQuery)
.appendQueryParameter(PARAM_SORT, sortBy)
// build the uri
// Convert the Uri to a URL:
URL url = null;
try {
url = new URL(builtUri.toString());
} catch (MalformedURLException e) {
return url;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment