Hi guys i am trying to do http requests i searched on internet and i found OkHttp library.
i am trying sample code:
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("http://www.vogella.com/index.html")
.build();
try {
Response response = client.newCall(request).execute();
} catch (IOException e) {
e.printStackTrace();
}
but the app crashes, i tried to find the error and the reason it crashes is this line:
Response response = client.newCall(request).execute();
can anyone help me? if not can you suggest me another library for http requests?
I have android 5.1(miui 8) and here are logcat errors:
http://pastebin.com/5LtdxvpG
line 42 is the line:
Response response = client.newCall(request).execute();