小编ank*_*bbr的帖子

改造错误 - 缺少@GET URL或@Url参数

我正在开发Youtube API.基本网址为https://www.googleapis.com/youtube/v3/search/ 请求:GET https://www.googleapis.com/youtube/v3/search?part=snippet&q= {search_keyword}&key = {API_键}

ApiService接口代码 -

https://www.googleapis.com/youtube/v3/search?part=snippet&q={search_keyword}&key={API_KEY}
Run Code Online (Sandbox Code Playgroud)

错误:java.lang.IllegalArgumentException:缺少@GET URL或@Url参数. 在代码行中

public interface ApiService {
    @GET("")
    Call<YoutubeResponse> searchVideos(@Query("part") String part,
                                   @Query("q") String q,@Query("key") String apiKey);
}
Run Code Online (Sandbox Code Playgroud)

我是初学者.请帮忙!

android retrofit retrofit2

35
推荐指数
1
解决办法
1万
查看次数

标签 统计

android ×1

retrofit ×1

retrofit2 ×1