本文整理匯總了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);