I have the following code
OkHttpClient client; Request request = new Request.Builder() .url("http://private-anon-2e719df222-newsapitest.apiary-proxy.com/api/news/football") .build(); Response response = client.newCall(request).execute();
But when you send the request client.newCall(request).execute() with the error:
Attempt to invoke virtual method 'okhttp3.Call okhttp3.OkHttpClient.newCall(okhttp3.Request)' on a null object reference
I understand that for some reason the request is not formed, but can't figure out what that is. Please tell me what could be the reason?