Java Code Examples for retrofit2.http.QueryMap

The following are top voted examples for showing how to use retrofit2.http.QueryMap. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: GitHub   File: RequestBuilderTest.java   View source code 6 votes vote down vote up
@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");
}
 
Example 2
Project: GitHub   File: RequestBuilderTest.java   View source code 6 votes vote down vote up
@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'.");
  }
}
 
Example 3
Project: tenor-android-core   File: IApiClient.java   View source code 5 votes vote down vote up
@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);
 
Example 4
Project: gplaymusic   File: GPlayService.java   View source code 5 votes vote down vote up
@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);
 
Example 5
Project: GitHub   File: RequestBuilderTest.java   View source code 5 votes vote down vote up
@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.");
  }
}
 
Example 6
Project: GitHub   File: RequestBuilderTest.java   View source code 5 votes vote down vote up
@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.");
  }
}
 
Example 7
Project: EvolvingNetLib   File: CCNetApiService.java   View source code 5 votes vote down vote up
/**
 * 下载文件
 * @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
);
 
Example 8
Project: gplaymusic   File: GPlayService.java   View source code 5 votes vote down vote up
@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);
 
Example 9
Project: Unofficial-Ups   File: UpcServiceInterface.java   View source code 4 votes vote down vote up
@GET("RecursosDisponible/")
Observable<ReserveAvailabilityResponse> getReservesAvailability(@QueryMap Map<String,String> filters,
                                                                @Query("CodAlumno") String userCode,
                                                                @Query("Token") String token);
 
Example 10
Project: easyappointments-android-client   File: CustomerService.java   View source code 4 votes vote down vote up
@GET("customers")
Call<List<CustomerModel>> get(@QueryMap Map<String, String> options);
 
Example 11
Project: easyappointments-android-client   File: CustomerService.java   View source code 4 votes vote down vote up
@GET("customers/{id}")
Call<CustomerModel> get(@Path("id") int id, @QueryMap Map<String, String> options);
 
Example 12
Project: easyappointments-android-client   File: ServiceService.java   View source code 4 votes vote down vote up
@GET("services")
Call<List<ServiceModel>> get(@QueryMap Map<String, String> options);
 
Example 13
Project: android-yelp-v3-api   File: YelpV3API.java   View source code 4 votes vote down vote up
@GET(TRANSACTION_SEARCH_PATH)
Call<SearchResponse> transactionSearch(
      @Path("transaction_type") String transaction_type,
      @QueryMap Map<String, String> parameters);
 
Example 14
Project: easyappointments-android-client   File: ProviderService.java   View source code 4 votes vote down vote up
@GET("providers/{id}")
Call<ProviderModel> get(@Path("id") int id, @QueryMap Map<String, String> options);
 
Example 15
Project: GitHub   File: UserApi.java   View source code 4 votes vote down vote up
@GET("user/login")
Observable<HttpResponse> login(@QueryMap Map<String, Object> request);
 
Example 16
Project: AndroidRequest   File: RetrofitHttpService.java   View source code 4 votes vote down vote up
@GET()
Call<String> get(@HeaderMap Map<String, String> headers, @Url String url, @QueryMap Map<String, String> params);
 
Example 17
Project: Ec2m   File: RetrofitService.java   View source code 4 votes vote down vote up
@POST("{url}")
Call<ResponseBody> createCommitResponseBody(@Url String url, @QueryMap Map<String, String> options);
 
Example 18
Project: Last.fm-API   File: LastFmService.java   View source code 4 votes vote down vote up
@GET(Endpoints.USER_TOP_ARTISTS)
Single<Response<ArtistPage>> fetchUserTopArtists(@Query("user") String user,
                                                   @QueryMap Map<String,Object> options);
 
Example 19
Project: SoundCloud-API   File: SoundCloudService.java   View source code 4 votes vote down vote up
@GET(Endpoints.TRACKS)
Single<Page<TrackEntity>> searchTracksPage(@QueryMap Map<String,Object> options);
 
Example 20
Project: xifan   File: ApiFactory.java   View source code 4 votes vote down vote up
@GET(Constants.FanFou.USER_FRIENDS_URL)
Observable<HttpResponseData<List<UserRes>>> getFriends(@QueryMap Map<String, String> queryMap);
 
Example 21
Project: Clipcon-Client   File: RetrofitInterface.java   View source code 4 votes vote down vote up
/** download */
@Streaming
@Headers({ "User-Agent: pcProgram" })
@GET("DownloadServlet")
Call<ResponseBody> requestFileDataDownload(@QueryMap Map<String, String> parameters);
 
Example 22
Project: Ec2m   File: RetrofitService.java   View source code 4 votes vote down vote up
@GET("{url}")
Observable<BaseCallModel> createRx2(@Url String url, @QueryMap Map<String, String> options);
 
Example 23
Project: Bing   File: RestService.java   View source code 4 votes vote down vote up
@GET
Call<String> get(@Url String url, @QueryMap WeakHashMap<String, Object> params);
 
Example 24
Project: Last.fm-API   File: LastFmService.java   View source code 4 votes vote down vote up
@GET(Endpoints.USER_WEEKLY_ARTIST)
Single<Response<AlbumPage>> fetchUserWeeklyArtistChart(@Query("user") String user,
                                                          @QueryMap Map<String,Object> options);
 
Example 25
Project: FriendBook   File: ServerAPI.java   View source code 4 votes vote down vote up
/**
 * 获取小说章节列表
 */
@GET("/v1/books/{bookId}/chapters")
Observable<HttpResult<List<BookSectionItem>>> getBookSectionList(@Path("bookId") String bookId,
                                                                 @QueryMap HashMap<String, Object> map);
 
Example 26
Project: xifan   File: ApiFactory.java   View source code 4 votes vote down vote up
@GET(Constants.FanFou.USER_SHOW_URL)
Observable<HttpResponseData<UserRes>> getUserInfo(@QueryMap Map<String, String> queryMap);
 
Example 27
Project: tumbviewer   File: BlogService.java   View source code 4 votes vote down vote up
@GET("/v2/blog/{id}/posts/{type}")
Call<BaseBean<BlogPosts>> getBlogPosts(@Path("id") String id,
                                       @Path("type") String type,
                                       @QueryMap HashMap<String, String> hashMap);
 
Example 28
Project: RxRetrofit-Android   File: SOService.java   View source code 4 votes vote down vote up
@GET()
Observable<Object> getAnswersRxTest(@Url String endPath, @QueryMap Map<String, Object> options);
 
Example 29
Project: Clipcon-AndroidClient   File: RetrofitInterface.java   View source code 4 votes vote down vote up
/** download */
@Streaming
@Headers({ "User-Agent: androidProgram" })
@GET("DownloadServlet")
Call<ResponseBody> requestFileDataDownload(@QueryMap Map<String, String> parameters);
 
Example 30
Project: Bing   File: RxRestService.java   View source code 4 votes vote down vote up
@GET
Observable<String> get(@Url String url, @QueryMap WeakHashMap<String, Object> params);
 
Example 31
Project: yelp-fusion-android   File: YelpFusionApi.java   View source code 4 votes vote down vote up
@GET("/v3/businesses/search")
Call<SearchResponse> getBusinessSearch(@QueryMap Map<String, String> params);
 
Example 32
Project: AcopioMX   File: RetroService.java   View source code 4 votes vote down vote up
@POST("acopios/{acopioId}/productos")
Observable<Producto> addProducto(@Path("acopioId") String acopioId,
                           @QueryMap Map<String, String> params,
                           @Body Aceptan aceptan);
 
Example 33
Project: SoundCloud-API   File: SoundCloudService.java   View source code 4 votes vote down vote up
@GET(Endpoints.PLAYLISTS)
Single<Page<PlaylistEntity>> searchPlaylistsPage(@QueryMap Map<String,Object> options);
 
Example 34
Project: garras   File: PixelsApis.java   View source code 4 votes vote down vote up
@PUT("me")
Flowable<Response<Me>> updateProfile(@QueryMap Map<String, Object> params);
 
Example 35
Project: AndroidRequest   File: RetrofitHttpService.java   View source code 4 votes vote down vote up
@GET()
Observable<String> Obget(@HeaderMap Map<String, String> headers, @Url String url, @QueryMap Map<String, String> params);
 
Example 36
Project: garras   File: PixelsApis.java   View source code 4 votes vote down vote up
@GET("photos")
Flowable<Response<List<Photos>>> photos(@QueryMap Map<String, Object> params);
 
Example 37
Project: AvenueNet   File: ClientService.java   View source code 4 votes vote down vote up
@DELETE
Observable<String> delete(@Url String url, @QueryMap Map<String, Object> params, @HeaderMap Map<String, Object> header);
 
Example 38
Project: XSnow   File: ApiService.java   View source code 4 votes vote down vote up
@HEAD()
Observable<ResponseBody> head(@Url String url, @QueryMap Map<String, String> maps);
 
Example 39
Project: AvenueNet   File: ClientService.java   View source code 4 votes vote down vote up
@GET
Observable<String> get(@Url String url, @QueryMap Map<String, Object> params, @HeaderMap Map<String, Object> header);
 
Example 40
Project: AcopioMX   File: RetroService.java   View source code 4 votes vote down vote up
@GET("productos")
Observable<List<Producto>> searchProducto(@QueryMap Map<String, String> params);