Retrofit 2 HTTP method annotation is required (e.g., @GET, @POST, etc.)

后端 未结 4 784
耶瑟儿~
耶瑟儿~ 2021-02-04 09:01

What\'s wrong with my Retrofit configuration? I\'m having this error when I\'m adding Basic Authentication with my OkHttpClient but when I used the default client without Interc

4条回答
  •  野的像风
    2021-02-04 09:37

    Using the wrong "@GET"

    This may help someone coming from retrofit1, I was getting this same error and the fix was simple. In my interface I was unaware that I was using @GET from retrofit.http and not @GET from retrofit2.http, changing the annotation from retrofit.http to retrofit2.http was all I needed to do.

提交回复
热议问题