Gio*_*oli 9 android http retrofit retrofit2
是否有可能将CallURL与Stringin 进行比较Retrofit 2?
例如,我们可以这样做baseUrl:
https://www.google.com
Run Code Online (Sandbox Code Playgroud)
这个Call:
public interface ExampleService {
@GET("dummy/{examplePartialUrl}/")
Call<JsonObject> exampleList(@Path("examplePartialUrl") String examplePartialUrl;
}
Run Code Online (Sandbox Code Playgroud)
有这个要求:
Call<JsonObject> mCall = dummyService.exampleList("partialDummy")
Run Code Online (Sandbox Code Playgroud)
有没有办法获得https://www.google.com/dummy/partialDummy或dummy/partialDummy在获得通话响应之前?
tre*_*r-e 21
假设您正在使用OkHttp和Retrofit,您可以执行以下操作:
dummyService.exampleList("partialDummy").request().url().toString()
根据OkHttp文档应该打印:
https://www.google.com/dummy/partialDummy
小智 5
Log.d(TAG, "onResponse: ConfigurationListener::"+call.request().url());
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
10625 次 |
| 最近记录: |