当前位置: 首页>>代码示例>>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;未经允许,请勿转载。