Created
December 28, 2015 02:23
-
-
Save ccjeng/0a193aea04725349cceb to your computer and use it in GitHub Desktop.
Okhttp http response sample
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
OkHttpClient client = new OkHttpClient(); | |
String url = "http://www.google.com"; | |
Request request = new Request.Builder() | |
.url(url) | |
.build(); | |
Response response = client.newCall(request).execute(); | |
//Response | |
Log.d(TAG, response.body().string()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment