Retrofit 2中@Path 和@Query的区别

来源:互联网 发布:教师远程网络培训 编辑:程序博客网 时间:2024/06/05 04:23

Consider this is the url:

www.app.net/api/searchtypes/862189/filters?Type=6&SearchText=School

Now this is the call:

@GET("/api/searchtypes/{Id}/filters")void getFilterList(@Path("Id") long customerId,          @Query("Type") String responseType,          @Query("SearchText") String searchText,          Callback<FilterResponse> filterResponse);

So we have:

www.app.net/api/searchtypes/{Path}/filters?Type={Query}&SearchText={Query}

Things that come after the ? are usually queries.

1 1
原创粉丝点击