Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Using OKHttp3


// It is used to get JsonData from URL


new
AsyncTask() {

@Override protected String doInBackground(Void... voids) {
OkHttpClient okHttp = new OkHttpClient();
Request request = new Request.Builder().url("https://api.github.com/users/ashokslsk").build();
try {
Response response = okHttp.newCall(request).execute();
System.out.println("ResponseRupal:::::" + response.body().string());
return "Hi";
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
}.execute();


This post first appeared on Unity Coroutine, please read the originial post: here

Share the post

Using OKHttp3

×

Subscribe to Unity Coroutine

Get updates delivered right to your inbox!

Thank you for your subscription

×