как передать значение параметра в Android-дооснащение - PullRequest
0 голосов
/ 13 ноября 2018

Вопрос по поводу "дооснащения"

У меня есть API, как это listing/get_listings?listing_type=featured в этом API у меня есть параметр listing_type ... я использую его так

@GET("listing/get_listings")
    Call<List<ProviderModel>> getProviderListing(@Query("listing_type") String listing_type);

Теперь я хочу добавить значение параметра следующим образом:

 RetrofitUtil.createProviderAPI().getProviderListing("featured").enqueue(getProviders(this));

но я не получаю ответ, может кто-нибудь помочь мне решить проблему

1 Ответ

0 голосов
/ 13 ноября 2018

добавить логинепрецептор и проверить проблему

implementation 'com.squareup.okhttp3:logging-interceptor:3.3.1'


 okhttp3.OkHttpClient.Builder client = new okhttp3.OkHttpClient.Builder();
    HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor();
    loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);


    client.addInterceptor(loggingInterceptor);


    Retrofit retrofit = new Retrofit.Builder().baseUrl(OfflineApi.base_url).client(client.build()).addConverterFactory(GsonConverterFactory.create()).build();
...