Retrofit error URL query string must not have replace block

前端 未结 4 554
北恋
北恋 2021-02-05 04:43

I have this function

      @GET(\"/users?filters[0][field]={param}&filters[0][operator]=equals&filters[0][value]={value}\")
UserDto retrieveUsersByFilte         


        
4条回答
  •  面向向阳花
    2021-02-05 05:41

    Query params have their own annotation which automatically appends to the URL.

    @GET("/users?filters[0][operator]=equals")
    UserDto retrieveUsersByFilters(
        @Query("filters[0][field]") String nameFilter,
        @Query("filters[0][value]") String value);
    

    You can read more about @Query on its Javadoc

提交回复
热议问题