Skip to content

Instantly share code, notes, and snippets.

@exhesham
Created June 8, 2018 09:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save exhesham/c612bda6121e47106950a171759a79d2 to your computer and use it in GitHub Desktop.
Save exhesham/c612bda6121e47106950a171759a79d2 to your computer and use it in GitHub Desktop.
Uri builtUri = Uri.parse(BASE_URL).buildUpon()
// add various params
.appendQueryParameter(PARAM_QUERY, githubSearchQuery)
.appendQueryParameter(PARAM_SORT, sortBy)
// build the uri
.build();
// Convert the Uri to a URL:
URL url = null;
try {
url = new URL(builtUri.toString());
} catch (MalformedURLException e) {
e.printStackTrace();
}
return url;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment