I try on this code but it is not work.
I'm trying to create code like the one below, but I couldn't.
I would like to assign the returned value from this code to a String value in MainActivity.
public class Client {
OkHttpClient client = new OkHttpClient();
public String getHttpBody(String url) throws IOException {
Request request = new Request.Builder().url(url).build();
Call call = client.newCall(request);
Response response = call.execute();
return response.body().string();
}
}