0
我有這個接口獲取天氣(來自openweather API)的城市RZESZOW和國家波蘭,我怎麼查詢參數?我需要從用戶那裏獲取城市名和國家,並得到數據Android翻新@GET參數
public interface RestInterface {
@GET("/weather?q=rzeszow,pl&appid=527f7a1296bd7b0f21e47fc01a982087")
void getWheatherReport(Callback<Model> cb);
}
在這裏,我把它叫做
//making object of RestAdapter
RestAdapter adapter = new RestAdapter.Builder().setEndpoint(url).build();
//Creating Rest Services
RestInterface restInterface = adapter.create(RestInterface.class);
//Calling method to get whether report
restInterface.getWheatherReport(new Callback<Model>() {
@Override
public void success(Model model, Response response) {
STUFF HERE >>>>>>>>>>>>>>.........<<<<<<<<<<<<<
}
我在哪裏可以瞭解更多關於改造,APIS,JSON等?
感謝我解決這個問題,如: @GET( 「/天氣的appid = 527f7a1296bd7b0f21e47fc01a982087?」) //無效getWheatherReport( Callback cb); void getName(@Query(「q」)String name,Callback cb); 謝謝! –
qstra