Created
June 8, 2018 09:35
-
-
Save exhesham/c612bda6121e47106950a171759a79d2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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