What I am trying to do::
I am trying to learn the usage of Okhttp for making networking calls in android
What I have done
The method execute(Request) is undefined for the type OkHttpClient
You are getting this exception because there is no such method ie.execute(Request) for OkHttpClient. Rather it is invoked on Call object which is obtained using OkHttpClient object as follows:
Call call = client.newCall(request);
Response response = call.execute();
I think you should be using
Response response = client.newCall(request).execute();
instead of Response response = client.execute(request);
OkHttp docs
OkHttp Blog