![](/img/trans.png)
[英]What is java.lang.IllegalArgumentException: URL query string "name={name}" must not have replace block. For dynamic query parameters use @Query
[英]Retrofit2 error : Java.lang.IllegalArgumentException: URL query string “a={action}&type=json&key=15670403” must not have replace block
對於動態查詢參數,我將@Query
用於方法RadioApiClient.getFeeds
以下是我嘗試操作的網址。
//api.broadcastify.com/audio/?a=feeds&type=json&key=1234567890
public interface RadioApiClient {
String BASE_URL = "http://api.broadcastify.com";
@GET("/audio/?a={action}&type=json&key=1234567890")
Call<List<Feeds>> getFeeds(@Query("a") String action);
}
我看了看文檔,但似乎沒有按預期工作。
這工作
@GET("/audio/type=json&key= 1234567890")
Call<List<Feeds>> getFeeds(@Query("a") String action);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.