compile 'com.squareup.okhttp:okhttp:2.2.0'
<uses-permission android:name="android.permission.INTERNET" />
private final OkHttpClient client= new OkHttpClient();
public void sendRequest() {
Request request = new Request.Builder()
.url("https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20weather.forecast%20where%20woeid%20in%20(select%20woeid%20from%20geo.places(1)%20where%20text%3D%22Bath%2C%20England%22)&format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys")
.build();
client.newCall(request).enqueue(new Callback() {
@Override
public void onFailure(Request request, IOException e) {
}
@Override public void onResponse(Response response) throws IOException {
Log.d("DANIELLE", response.body().string());
}
});
}