1
我需要GET請求與此查詢:如何使用Retrofit2創建查詢數組請求?
.../apartments?category[first][one]=53&category[first][two]=27&category[second][one]=53&category[second][two]=27&order=created_at&page=1
我嘗試添加像這樣:
public interface ApiService {
@GET(SEARCH + CATEGORY)
Observable<Responce> getResponceObservable(
@Query("category[first][one]") double var1,
@Query("category[first][two]") double var2,
@Query("category[second][one]") double var3,
@Query("category[second][two]") double var4,
@Query("order") String order,
@Query("page") int page
);
但在日誌中的錯誤是因爲以下幾點:
<-- 415 Unsupported Media Type https://base.com/search/categories?category[first][one]=53&category[first][two]=53&category[second][one]=53&category[second][two]=53&order=created_at&page=1 (384ms)