當前位置: 首頁>>代碼示例>>Java>>正文


Java QueryMap類代碼示例

本文整理匯總了Java中retrofit2.http.QueryMap的典型用法代碼示例。如果您正苦於以下問題:Java QueryMap類的具體用法?Java QueryMap怎麽用?Java QueryMap使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


QueryMap類屬於retrofit2.http包,在下文中一共展示了QueryMap類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: queryMapSupportsSubclasses

import retrofit2.http.QueryMap; //導入依賴的package包/類
@Test public void queryMapSupportsSubclasses() {
  class Foo extends HashMap<String, String> {
  }

  class Example {
    @GET("/") //
    Call<ResponseBody> method(@QueryMap Foo a) {
      return null;
    }
  }

  Foo foo = new Foo();
  foo.put("hello", "world");

  Request request = buildRequest(Example.class, foo);
  assertThat(request.url().toString()).isEqualTo("http://example.com/?hello=world");
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:18,代碼來源:RequestBuilderTest.java

示例2: queryMapRejectsNullValues

import retrofit2.http.QueryMap; //導入依賴的package包/類
@Test public void queryMapRejectsNullValues() {
  class Example {
    @GET("/") //
    Call<ResponseBody> method(@QueryMap Map<String, String> a) {
      return null;
    }
  }

  Map<String, String> queryParams = new LinkedHashMap<>();
  queryParams.put("ping", "pong");
  queryParams.put("kit", null);

  try {
    buildRequest(Example.class, queryParams);
    fail();
  } catch (IllegalArgumentException e) {
    assertThat(e).hasMessage("Query map contained null value for key 'kit'.");
  }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:20,代碼來源:RequestBuilderTest.java

示例3: getSuggestions

import retrofit2.http.QueryMap; //導入依賴的package包/類
@GET("suggest")
Call<Suggestions> getSuggestions(@QueryMap Map<String, String> serviceIds,
                                 @Query("tag") String tag,
                                 @Query("limit") Integer limit,
                                 @Query("type") String type,
                                 @Query("timezone") String utcOffset,
                                 @Query("allterms") boolean isAllTerms);
 
開發者ID:Tenor-Inc,項目名稱:tenor-android-core,代碼行數:8,代碼來源:IApiClient.java

示例4: getTrackLocationMJCK

import retrofit2.http.QueryMap; //導入依賴的package包/類
@GET("music/{provider}?net=mob&pt=e")
Call<Void> getTrackLocationMJCK(@Header("X-Device-ID") String androidID,
                                @Path("provider") Provider provider,
                                @Query("opt") StreamQuality quality,
                                @Query("slt") String salt,
                                @Query("sig") String signature,
                                @Query("mjck") String trackID,
                                @QueryMap Map<String, String> kwargs);
 
開發者ID:FelixGail,項目名稱:gplaymusic,代碼行數:9,代碼來源:GPlayService.java

示例5: queryMapRejectsNull

import retrofit2.http.QueryMap; //導入依賴的package包/類
@Test public void queryMapRejectsNull() {
  class Example {
    @GET("/") //
    Call<ResponseBody> method(@QueryMap Map<String, String> a) {
      return null;
    }
  }

  try {
    buildRequest(Example.class, new Object[] { null });
    fail();
  } catch (IllegalArgumentException e) {
    assertThat(e).hasMessage("Query map was null.");
  }
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:16,代碼來源:RequestBuilderTest.java

示例6: executeDownload

import retrofit2.http.QueryMap; //導入依賴的package包/類
/**
 * 下載文件
 * @param url
 * @param headerMap
 * @param txtParamMap
 * @return
 */
@Streaming
@GET
Call<ResponseBody> executeDownload(
        @Url String url,
        @HeaderMap Map<String, String> headerMap,
        @QueryMap Map<String, String> txtParamMap
);
 
開發者ID:CodingCodersCode,項目名稱:EvolvingNetLib,代碼行數:15,代碼來源:CCNetApiService.java

示例7: getTrackLocationSongId

import retrofit2.http.QueryMap; //導入依賴的package包/類
@GET("music/{provider}?net=mob&pt=e")
Call<Void> getTrackLocationSongId(@Header("X-Device-ID") String androidID,
                                  @Path("provider") Provider provider,
                                  @Query("opt") StreamQuality quality,
                                  @Query("slt") String salt,
                                  @Query("sig") String signature,
                                  @Query("songid") String trackID,
                                  @QueryMap Map<String, String> kwargs);
 
開發者ID:FelixGail,項目名稱:gplaymusic,代碼行數:9,代碼來源:GPlayService.java

示例8: getReservesAvailability

import retrofit2.http.QueryMap; //導入依賴的package包/類
@GET("RecursosDisponible/")
Observable<ReserveAvailabilityResponse> getReservesAvailability(@QueryMap Map<String,String> filters,
                                                                @Query("CodAlumno") String userCode,
                                                                @Query("Token") String token);
 
開發者ID:Bruno125,項目名稱:Unofficial-Ups,代碼行數:5,代碼來源:UpcServiceInterface.java

示例9: get

import retrofit2.http.QueryMap; //導入依賴的package包/類
@GET("customers")
Call<List<CustomerModel>> get(@QueryMap Map<String, String> options);
 
開發者ID:alextselegidis,項目名稱:easyappointments-android-client,代碼行數:3,代碼來源:CustomerService.java

示例10: get

import retrofit2.http.QueryMap; //導入依賴的package包/類
@GET("services")
Call<List<ServiceModel>> get(@QueryMap Map<String, String> options);
 
開發者ID:alextselegidis,項目名稱:easyappointments-android-client,代碼行數:3,代碼來源:ServiceService.java

示例11: transactionSearch

import retrofit2.http.QueryMap; //導入依賴的package包/類
@GET(TRANSACTION_SEARCH_PATH)
Call<SearchResponse> transactionSearch(
      @Path("transaction_type") String transaction_type,
      @QueryMap Map<String, String> parameters);
 
開發者ID:nickwu241,項目名稱:android-yelp-v3-api,代碼行數:5,代碼來源:YelpV3API.java

示例12: get

import retrofit2.http.QueryMap; //導入依賴的package包/類
@GET("providers/{id}")
Call<ProviderModel> get(@Path("id") int id, @QueryMap Map<String, String> options);
 
開發者ID:alextselegidis,項目名稱:easyappointments-android-client,代碼行數:3,代碼來源:ProviderService.java

示例13: login

import retrofit2.http.QueryMap; //導入依賴的package包/類
@GET("user/login")
Observable<HttpResponse> login(@QueryMap Map<String, Object> request);
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:3,代碼來源:UserApi.java

示例14: get

import retrofit2.http.QueryMap; //導入依賴的package包/類
@GET()
Call<String> get(@HeaderMap Map<String, String> headers, @Url String url, @QueryMap Map<String, String> params);
 
開發者ID:jingle1267,項目名稱:AndroidRequest,代碼行數:3,代碼來源:RetrofitHttpService.java

示例15: createCommitResponseBody

import retrofit2.http.QueryMap; //導入依賴的package包/類
@POST("{url}")
Call<ResponseBody> createCommitResponseBody(@Url String url, @QueryMap Map<String, String> options);
 
開發者ID:yzzslow0,項目名稱:Ec2m,代碼行數:3,代碼來源:RetrofitService.java


注:本文中的retrofit2.http.QueryMap類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。