本文整理汇总了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");
}
示例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'.");
}
}
示例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);
示例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);
示例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.");
}
}
示例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
);
示例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);
示例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);
示例9: get
import retrofit2.http.QueryMap; //导入依赖的package包/类
@GET("customers")
Call<List<CustomerModel>> get(@QueryMap Map<String, String> options);
示例10: get
import retrofit2.http.QueryMap; //导入依赖的package包/类
@GET("services")
Call<List<ServiceModel>> get(@QueryMap Map<String, String> options);
示例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);
示例12: get
import retrofit2.http.QueryMap; //导入依赖的package包/类
@GET("providers/{id}")
Call<ProviderModel> get(@Path("id") int id, @QueryMap Map<String, String> options);
示例13: login
import retrofit2.http.QueryMap; //导入依赖的package包/类
@GET("user/login")
Observable<HttpResponse> login(@QueryMap Map<String, Object> request);
示例14: get
import retrofit2.http.QueryMap; //导入依赖的package包/类
@GET()
Call<String> get(@HeaderMap Map<String, String> headers, @Url String url, @QueryMap Map<String, String> params);
示例15: createCommitResponseBody
import retrofit2.http.QueryMap; //导入依赖的package包/类
@POST("{url}")
Call<ResponseBody> createCommitResponseBody(@Url String url, @QueryMap Map<String, String> options);